Skip to content

Commit

Permalink
Add path argument to NoMethod class
Browse files Browse the repository at this point in the history
Resolves #77
  • Loading branch information
eric-spitler committed Nov 2, 2023
1 parent 8893c4a commit 2a2f21a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sanic_routing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from .route import Route
from .router import BaseRouter

__version__ = "23.6.0"
__version__ = "23.6.1"
__all__ = ("BaseRouter", "Route", "RouteGroup")
2 changes: 2 additions & 0 deletions sanic_routing/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ def __init__(
message: str = "Method does not exist",
method: Optional[str] = None,
allowed_methods: Optional[Set[str]] = None,
path: Optional[str] = None
):
super().__init__(message)
self.method = method
self.allowed_methods = allowed_methods
self.path = path


class FinalizationError(BaseException):
Expand Down
2 changes: 1 addition & 1 deletion sanic_routing/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def resolve(
orig=path,
extra=extra,
)
raise self.exception(str(e), path=path)
raise e.__class__(str(e), path=path)

if isinstance(route, RouteGroup):
try:
Expand Down

0 comments on commit 2a2f21a

Please sign in to comment.