No logging of exception
This commit is contained in:
parent
2e36507a60
commit
ca0e933813
|
@ -58,7 +58,7 @@ class DirectoryHandler:
|
|||
@classmethod
|
||||
def default_handler(
|
||||
cls, request: Request, exception: SanicIsADirectoryError
|
||||
) -> Optional[Union[HTTPResponse, Coroutine[Any, Any, HTTPResponse]]]:
|
||||
) -> Optional[Coroutine[Any, Any, HTTPResponse]]:
|
||||
if exception.autoindex or exception.index_name:
|
||||
maybe_response = DirectoryHandler(
|
||||
exception.location, exception.autoindex, exception.index_name
|
||||
|
|
|
@ -27,7 +27,12 @@ from sanic.base.meta import SanicMeta
|
|||
from sanic.compat import stat_async
|
||||
from sanic.constants import DEFAULT_HTTP_CONTENT_TYPE, HTTP_METHODS
|
||||
from sanic.errorpages import RESPONSE_MAPPING
|
||||
from sanic.exceptions import FileNotFound, HeaderNotFound, RangeNotSatisfiable
|
||||
from sanic.exceptions import (
|
||||
FileNotFound,
|
||||
HeaderNotFound,
|
||||
RangeNotSatisfiable,
|
||||
SanicIsADirectoryError,
|
||||
)
|
||||
from sanic.handlers import ContentRangeHandler
|
||||
from sanic.log import error_logger
|
||||
from sanic.models.futures import FutureRoute, FutureStatic
|
||||
|
@ -910,7 +915,7 @@ class RouteMixin(metaclass=SanicMeta):
|
|||
autoindex=autoindex,
|
||||
index_name=index_name,
|
||||
)
|
||||
except RangeNotSatisfiable:
|
||||
except (RangeNotSatisfiable, SanicIsADirectoryError):
|
||||
raise
|
||||
except FileNotFoundError:
|
||||
raise not_found
|
||||
|
|
|
@ -27,7 +27,7 @@ class BasePage(ABC):
|
|||
|
||||
@property
|
||||
def style(self) -> str:
|
||||
return f"{self.BASE_STYLE}\n{self.EXTRA_STYLE}"
|
||||
return self.BASE_STYLE + self.EXTRA_STYLE
|
||||
|
||||
def render(self) -> str:
|
||||
self._head()
|
||||
|
|
Loading…
Reference in New Issue
Block a user