Skip to content
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(listener): support custom error handler #131

Merged
merged 7 commits into from
Jan 29, 2024

Conversation

marbemac
Copy link
Contributor

Would ya'll be open to this kind of option?

Open to alternative approaches, but basically what I'm after is a means for the consumer to be able to provide it's own error handler so that it can, for example, pass the error down the middleware chain in a Vite dev server. This allows vite to display the standard pretty error overlay on the client, etc.

See example of how it can be used in honojs/vite-plugins#63 (this PR blocks that PR).

src/listener.ts Outdated Show resolved Hide resolved
src/listener.ts Outdated Show resolved Hide resolved
@yusukebe
Copy link
Member

Hi @marbemac !

This is an awesome feature! I have been wanting a feature like this. Please check my comments. Also, please add proper tests. Thanks.

@marbemac
Copy link
Contributor Author

Hi @yusukebe - alrighty, I've adjusted the function signature to accept the options object, and added some tests. LMK if the code style / test style works for you, or if you'd like any other changes!

Signed-off-by: Marc MacLeod <[email protected]>
@yusukebe
Copy link
Member

Hi @marbemac

Please run:

yarn lint:fix && yarn format:fix

Signed-off-by: Marc MacLeod <[email protected]>
@marbemac
Copy link
Contributor Author

done

@yusukebe
Copy link
Member

Greeeat! I'll merge it and ship the new version. Thanks!

@yusukebe yusukebe merged commit 8a9b7cf into honojs:main Jan 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants