Error handling seems a little cumbersome (improve DX?) #60
Closed
harrywebdev
started this conversation in
Ideas
Replies: 2 comments
-
If you see how it can be improved, describe a solution you would like to see based on your experience. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Already fixed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider this example:
Let's look at the types:
so the
EvoluError
is a wrapper and its propertyerror
contains the actual error. Now, this error contains various types, ranging from errors without an actual message (their type is the basis for the message) like:to an unknown error with a message (wrapped under the
error
property)Maybe for production cases, the
EvoluError.error.type
is enough to produce a feedback message to the user, and the wrap to get a message fromUnknownError
is good enough for debugging purposes. Maybe, we could do better in how we surface errors - the way I came across this was when I struggled with a correct SQL query and I was getting at the actual DB error message.Beta Was this translation helpful? Give feedback.
All reactions