diff --git a/sanic/exceptions.py b/sanic/exceptions.py index 5bf5f2de..0133fd64 100644 --- a/sanic/exceptions.py +++ b/sanic/exceptions.py @@ -177,8 +177,6 @@ class URLBuildError(ServerError): class FileNotFound(NotFound): - pass - def __init__(self, message, path, relative_url): super().__init__(message) self.path = path @@ -208,8 +206,6 @@ class HeaderNotFound(InvalidUsage): @add_status_code(416) class ContentRangeError(SanicException): - pass - def __init__(self, message, content_range): super().__init__(message) self.headers = { diff --git a/sanic/router.py b/sanic/router.py index 4f5470c0..f97cdbde 100644 --- a/sanic/router.py +++ b/sanic/router.py @@ -419,7 +419,7 @@ class Router: """ try: handler = self.get(request)[0] - except (NotFound, InvalidUsage): + except (NotFound, MethodNotSupported): return False if (hasattr(handler, 'view_class') and hasattr(handler.view_class, request.method.lower())):