Closed Filimoa closed 1 year ago
I added an example for error handling (examples/error_handling.py
).
Not sure if this counts as best practice, though. Do you have other ideas?
I assume the added example is what you were looking for. So I will close the issue.
What is the best practice when it comes to handling errors with this libary? Should I be wrapping my event generator with a try, except block and return a
{event: "error")
response? This would be a great addition to the docs and I'll gladly open a pull request.Here's some example code with the situation in question with fastapi.