Repository navigation
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. |
0 replies
|
Already fixed |
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
EvoluErroris a wrapper and its propertyerrorcontains 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
errorproperty)Maybe for production cases, the
EvoluError.error.typeis enough to produce a feedback message to the user, and the wrap to get a message fromUnknownErroris 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.All reactions