async def METHOD_NAME(self, request, exception):
    await self._apm_handler(request, exception)
    handler = self._current_handler.lookup(exception)
    response = None
    try:
        if handler:
            response = handler(request, exception)
        if response is None:
            response = self._current_handler.default(request, exception)
    except Exception:
        try:
            url = repr(request.url)
        except AttributeError:
            url = "unknown"
        response_message = "Exception raised in exception handler " '"%s" for uri: %s'
        logger.exception(response_message, handler.__name__, url)
        if self.debug:
            return text(response_message % (handler.__name__, url), 500)
        else:
            return text("An error occurred while handling an error", 500)
    if iscoroutinefunction(response) or isawaitable(response):
        return await response
    return response