marshmallow-code / marshmallow-code/flask-smorest

Reasoning for Errorhandlers on the API vs Blueprint

Open
#174 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
717
Forks
77
Avg merge
7h 49m
Merged PRs (30d)
3

Description

Currently the errorhandlers are added on a application basis via the ErrorHandlerMixin on the API class. Flask also allows to define the error handlers on the Blueprint level. What is the reasoning to use application level error handlers?

I can see the following pros/cons:

Pro:

  • Simplicity: single registration on the application level
  • Handling of unknown routes

Con:

  • Can hide user defined error handlers or can be hidden by user defined handlers.
  • Also applies to non API Routes
  • Currently no mention in the docs that the handlers are registered on the application level.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the ErrorHandlerMixin on the API class and Flask's application- and Blueprint-level error-handler behavior. Compare the listed pros and cons, especially unknown routes and non-API routes, then document the rationale and clarify the registration level in the project documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.