• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spec-first / connexion / 6682296237
94%

Build:
DEFAULT BRANCH: main
Ran 29 Oct 2023 08:43AM UTC
Jobs 5
Files 53
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Oct 2023 08:37AM UTC coverage: 94.409% (-0.04%) from 94.453%
6682296237

push

github

web-flow
Centralize error handling in ExceptionMiddleware (#1754)

I was writing the documentation on exception handling, and I noticed
that it was very hard to explain our current behavior.

Error handlers can be registered either on the internal Flask app (not
the Starlette one) or on the Connexion app, which leads to some
undefined (actually just really hard to explain) behavior. Eg.
- Registering error handlers on a status code would capture
`starlette.HTTPException` errors on the Connexion app, and
`werkzeug.HTTPException` errors on the Flask App, which means that
registering an error handler on a status code doesn't catch all the
errors with that status code.
- Flask does some default error handling which leads to some exceptions
never reaching the error handlers registered on the Connexion app.

So I made the following changes:
- Replaced the default error handlers we registered on the Flask app
with a default handler on the `ExceptionMiddleware` that takes into
account other handlers registered on status codes.
- Configured Flask to propagate exceptions instead of catching them.
- Abstracted away the Starlette `Request` and `Response` types, so users
can and must now use `ConnexionRequest`
  and `ConnexionResponse` types in error handlers.
- Renamed the `ASGIRequest` class to `ConnexionRequest` since it is the
only Request class part of the high level
  Connexion interface.

We could also rename `ConnexionRequest` and `ConnexionResponse` to just
`Request` and `Response`. Wdyt?

78 of 81 new or added lines in 12 files covered. (96.3%)

1 existing line in 1 file now uncovered.

3563 of 3774 relevant lines covered (94.41%)

4.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 test-3.9 - 6682296237.1 29 Oct 2023 08:55AM UTC 0
94.39
2 test-3.12 - 6682296237.2 29 Oct 2023 08:55AM UTC 0
94.41
3 test-3.8 - 6682296237.3 29 Oct 2023 08:55AM UTC 0
94.39
4 test-3.11 - 6682296237.4 29 Oct 2023 08:55AM UTC 0
94.41
5 test-3.10 - 6682296237.5 29 Oct 2023 08:55AM UTC 0
94.41
Source Files on build 6682296237
Detailed source file information is not available for this build.
  • Back to Repo
  • b9ba13cd on github
  • Prev Build on main (#6619077545)
  • Next Build on main (#6682303960)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc