Merge release 21.9.2 (#2313)
This commit is contained in:
@@ -1631,7 +1631,9 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
|
||||
self._future_registry.clear()
|
||||
self.signalize()
|
||||
self.finalize()
|
||||
ErrorHandler.finalize(self.error_handler)
|
||||
ErrorHandler.finalize(
|
||||
self.error_handler, fallback=self.config.FALLBACK_ERROR_FORMAT
|
||||
)
|
||||
TouchUp.run(self)
|
||||
|
||||
async def _server_event(
|
||||
|
||||
@@ -38,7 +38,14 @@ class ErrorHandler:
|
||||
self.base = base
|
||||
|
||||
@classmethod
|
||||
def finalize(cls, error_handler):
|
||||
def finalize(cls, error_handler, fallback: Optional[str] = None):
|
||||
if (
|
||||
fallback
|
||||
and fallback != "auto"
|
||||
and error_handler.fallback == "auto"
|
||||
):
|
||||
error_handler.fallback = fallback
|
||||
|
||||
if not isinstance(error_handler, cls):
|
||||
error_logger.warning(
|
||||
f"Error handler is non-conforming: {type(error_handler)}"
|
||||
|
||||
Reference in New Issue
Block a user