예제 #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())
예제 #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())
예제 #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())
예제 #4
0
파일: bot.py 프로젝트: ml-ds-data/chiron
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()