Skip to content

Commit

Permalink
Standardize init of exceptions (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Mar 20, 2023
1 parent 89188f5 commit 71cd53b
Show file tree
Hide file tree
Showing 4 changed files with 482 additions and 52 deletions.
35 changes: 35 additions & 0 deletions sanic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@
from sanic.app import Sanic
from sanic.blueprints import Blueprint
from sanic.constants import HTTPMethod
from sanic.exceptions import (
BadRequest,
ExpectationFailed,
FileNotFound,
Forbidden,
HeaderNotFound,
InternalServerError,
InvalidHeader,
MethodNotAllowed,
NotFound,
RangeNotSatisfiable,
SanicException,
ServerError,
ServiceUnavailable,
Unauthorized,
)
from sanic.request import Request
from sanic.response import (
HTTPResponse,
empty,
file,
html,
json,
raw,
redirect,
text,
)
Expand All @@ -17,16 +34,34 @@

__all__ = (
"__version__",
# Common objects
"Sanic",
"Blueprint",
"HTTPMethod",
"HTTPResponse",
"Request",
"Websocket",
# Common exceptions
"BadRequest",
"ExpectationFailed",
"FileNotFound",
"Forbidden",
"HeaderNotFound",
"InternalServerError",
"InvalidHeader",
"MethodNotAllowed",
"NotFound",
"RangeNotSatisfiable",
"SanicException",
"ServerError",
"ServiceUnavailable",
"Unauthorized",
# Common response methods
"empty",
"file",
"html",
"json",
"raw",
"redirect",
"text",
)

0 comments on commit 71cd53b

Please sign in to comment.