-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add defineNitroErrorHandler
type helper
#1923
Conversation
Having a named function presents it in stack traces to developers, clarifying that an error occurred within the default error handler itself.
- The description is extended to explain that the handler can be async - Update the example to use the `defineErrorHandler` definer function - Changed the implementation of the error handler to one that uses some of h3's functions.
An alphabetically sorted list is easier to find an entry in and easier to confirm an absence as well.
β Live Preview ready!
|
defineErrorHandler
Thanks! Maybe for consistency with type name we can name if decineNitroErrorHandler? |
As package maintainer the API (incl naming conventions) would be your decision / responsibility. |
defineErrorHandler
utildefineNitroErrorHandler
util
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
defineNitroErrorHandler
utildefineNitroErrorHandler
type helper
I see you added 355ea89 in order to reduce the size of the merge. I can rebase the other commit out as well, then it won't be in the history anymore |
Thanks no need we always squash :) |
π Linked issue
#1922
β Type of change
π Description
defineErrorHandler
function that follows the definer pattern.defineErrorHandler
function in the auto-import list.errorHandler
on the Configuration page, to use the new function.errorHandler
in a bit more detailThese changes are needed as described in #1922 I believe the "definer pattern" (I guess it is the factory pattern but the
defineX
gives it a nice recognizable shape) is an important feature of nitro and provides good ergonomic value to users of the library.Please note that I made several smaller commits, feel free to pick and choose the changes to make it fit with the project as a whole.
Resolves #1922
π Checklist