Best practices for error handling? #480
Replies: 2 comments 1 reply
-
Good question. I don't have experience from Django, as the Django project I work on is in early development, so error handling wasn't considered yet. So we just let the error propage, and let Django format it. Do not do this, tho. But you caught my attention with the "but that stops rendering". In React/Vue, there's a concept of "error boundaries" (Vue example). It is a place or a "bin" in the template that captures all templating errors inside of it: <error-boundary>
<counter />
</error-boundary> How error boundaries work is that when the template inside renders successfully, it's as if the error boundary wasn't there. But if there is an error during render, then the content of Is that what you're thinking of? After a quick google search I haven't found a Django version of error boundary. |
Beta Was this translation helpful? Give feedback.
-
Yes, something like that. One typical scenario:
|
Beta Was this translation helpful? Give feedback.
-
How do people handle error signaling from component to the containing view? It would seem natural to use exceptions, but that stops rendering.
Beta Was this translation helpful? Give feedback.
All reactions