Skip to content

Conversation

@waketzheng
Copy link
Contributor

Description

Fixes #1874

Motivation and Context

starlette (used by fastapi) added a DeprecationWarning for @app.exception_handler:
https://github.com/encode/starlette/blob/a7d0b14c7378aa2e95b0b13583fe0dadace363be/starlette/applications.py#L166

How Has This Been Tested?

PYTHONPATH=examples/fastapi pytest examples/fastapi/_tests.py

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #1880 will not alter performance

Comparing waketzheng:fix-fastapi-exception-handle (7c05844) with develop (7cb24a5)

Summary

✅ 12 untouched benchmarks

@waketzheng waketzheng merged commit 1dd9def into tortoise:develop Feb 7, 2025
9 checks passed
@waketzheng waketzheng deleted the fix-fastapi-exception-handle branch February 24, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FastAPI RegisterTortoise cannot add exception handlers during FastAPI lifespan

2 participants