You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been implementing a custom error handler using onError and it works fine, except for one part. Since every error is wrapped using H3Error class, code like this isn't possible:
Hi and thanks for the suggestion. I think it is really valid cause to have the need of accessing the original error object. As a more generic fix, i think we can make original error accessible from wrapped object.
Describe the feature
Hi,
I've been implementing a custom error handler using
onError
and it works fine, except for one part. Since every error is wrapped using H3Error class, code like this isn't possible:This would be super useful in case of custom validation error handling, for example,
ZodError
class. The key part missing isinstanceof
since each error is wrapped using H3 (https://github.com/unjs/h3/blob/main/src/error.ts#L55).I was wondering, is there interest in providing an option to
AppOptions
for "vanilla" error classes?Additional information
The text was updated successfully, but these errors were encountered: