Skip to content

Commit ad551c8

Browse files
fix #51
1 parent 4988456 commit ad551c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/exceptionite/solutions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def get(cls):
5353
ModelNotFound(),
5454
DatabaseDriverNotFound(),
5555
DriverNotFound(),
56+
MethodNotAllowed(),
5657
]
5758

5859

@@ -396,6 +397,18 @@ def regex(self):
396397
return r"^Could not find the '(?P<package>([\w]*))' library"
397398

398399

400+
class MethodNotAllowed:
401+
def title(self):
402+
return "HTTP Method Not Allowed"
403+
404+
def description(self):
405+
return "You tried to make a :method request on this URL but only :allowed_methods methods are allowed. If you want to use this method, update your routes file else use the allowed methods for making the request to this URL."
406+
407+
def regex(self):
408+
return r"^(?P<method>([\w]*)) method not allowed for this route. Supported methods are: (?P<allowed_methods>(\w+\,?\s?)*)."
409+
# return r"^(?P<method>([\w+])) method not allowed for this route. Supported methods are: (?P<allowed_methods>(\w,+))."
410+
411+
399412
class DatabaseDriverNotFound:
400413
def title(self):
401414
return "Database Driver Is Not Installed"

0 commit comments

Comments
 (0)