This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Repository navigation
Add custom handler of exceptions - #425
Merged
Merged
Conversation
This will change the way we visualize the Exceptions in FastAPI to a more
traditional unformatted approach.
```
File "/Users/aponcedeleonch/py_venvs/codegate_env/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2505, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/Users/aponcedeleonch/py_venvs/codegate_env/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 1005, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aponcedeleonch/StacklokRepos/codegate/src/codegate/dashboard/dashboard.py", line 35, in get_messages
raise Exception("This is a test exception")
2024-12-19T13:45:25.3dZ [error ] module=server pathname=/Users/aponcedeleonch/StacklokRepos/codegate/src/codegate/server.py
2024-12-19T13:45:25.3dZ [info ] ::1:59820 - "GET /dashboard/messages HTTP/1.1" 500 module=h11_impl pathname=/Users/aponcedeleonch/py_venvs/codegate_env/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py
```
The advantage would be that we would no longer get really long exceptions from FastAPI
Member
Author
|
This is mostly cosmetic. Will leave it here but feel free to close without merging |
JAORMX
approved these changes
Dec 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will change the way we visualize the Exceptions in FastAPI to a more traditional unformatted approach.
The advantage would be that we would no longer get really long exceptions from FastAPI