示例#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()