feat: add 405 method not allowed error handler - #327
Conversation
|
@rudra3007-pro is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
komalharshita
left a comment
There was a problem hiding this comment.
Good contribution overall. The dedicated 405 error handler is implemented cleanly and follows the existing application error-handling pattern well.
The custom template improves user experience compared to the default Flask response, and the PR stays properly scoped without introducing unrelated modifications. Reusing the shared styling system also keeps the implementation consistent with the rest of the project.
Minor non-blocking suggestion: consider moving the inline button styles into the shared stylesheet for better maintainability in future iterations.
Approved for merge.
Summary
Added a 405 Method Not Allowed error handler to match the existing 404
and 500 handlers in
app.py. Also added a styledtemplates/405.htmlpage consistent with the rest of the error pages in the app.
Related Issue
Closes #326
Type of Change
What Was Changed
app.pymethod_not_allowederror handler for 405templates/405.htmlHow to Test This PR
git checkout feat/405-error-handlerpip install -r requirements.txtpython app.pycurl -X GET http://127.0.0.1:5000/api/recommend
Self-Review Checklist
feat/405-error-handlerpython tests/test_basic.pyand all tests passflake8 .locally and there are no errorsprint()debug statementsNotes for Reviewer
Follows the exact same pattern as the existing 404 and 500 handlers.
The 405.html template reuses the same CSS classes as 404.html.