Esempio n. 1
0
async def startlette_exception_handler(request, exc):
    logging.exception(exc)

    return JSONResponse(
        Response(success=False,
                 error_code=exc.status_code,
                 message=str(exc.detail)).dict())
Esempio n. 2
0
async def mongoengine_operation_exception_handler(request, exc):
    logging.exception(exc)
    return JSONResponse(
        Response(success=False, error_code=422, message=str(exc)).dict())
Esempio n. 3
0
async def app_does_not_exist_exception_handler(request, exc):
    logging.exception(exc)
    return JSONResponse(
        Response(success=False, error_code=422, message=str(exc)).dict())
Esempio n. 4
0
async def get_intents(current_user: User = Depends(auth.get_current_user)):
    """ This function returns the list of existing intents of the bot """
    return Response(
        data=mongo_processor.get_intents(current_user.get_bot())).dict()