async def aiohttp_error_middleware(request, handler):
    try:
        response = await handler(request)
        return response
    except BotActionNotImplementedError:
        raise HTTPNotImplemented()
    except NotImplementedError:
        raise HTTPNotImplemented()
    except PermissionError:
        raise HTTPUnauthorized()
    except KeyError:
        raise HTTPNotFound()
    except Exception:
        raise HTTPInternalServerError()
async def aiohttp_error_middleware(request, handler):
    try:
        response = await handler(request)
        return response
    except BotActionNotImplementedError:
        raise HTTPNotImplemented()
    except NotImplementedError:
        raise HTTPNotImplemented()
    except PermissionError:
        raise HTTPUnauthorized()
    except KeyError:
        raise HTTPNotFound()
    except HTTPError as error:
        # In the case the integration adapter raises a specific HTTPError
        raise error
    except Exception:
        raise HTTPInternalServerError()
Пример #3
0
 async def update_record(self, request):
     raise HTTPNotImplemented()
Пример #4
0
 async def transfer_record(self, request):
     raise HTTPNotImplemented()
Пример #5
0
 async def fetch_record(self, request):
     raise HTTPNotImplemented()
Пример #6
0
 async def list_records(self, request):
     raise HTTPNotImplemented()
Пример #7
0
 async def authorize(self, request):
     raise HTTPNotImplemented()