Skip to content

mention exceptions in the execution order section#636

Merged
yusukebe merged 2 commits intohonojs:mainfrom
alsuren:patch-1
Apr 11, 2025
Merged

mention exceptions in the execution order section#636
yusukebe merged 2 commits intohonojs:mainfrom
alsuren:patch-1

Conversation

@alsuren
Copy link
Copy Markdown
Contributor

@alsuren alsuren commented Apr 10, 2025

This is something that caused a lot of confusion when I was getting onboarded onto a hono-based project recently. It feels like it is worth calling out explicitly.

This is also a perfect opportunity for me to check for more holes in my understanding. Is what I've written correct, or is there a better mental model that I should be using instead?

This is something that caused a lot of confusion when I was getting onboarded onto a hono-based project recently. It feels like it is worth calling out explicitly.
Comment thread docs/guides/middleware.md Outdated
@yusukebe
Copy link
Copy Markdown
Member

Hey @alsuren

Your understanding is correct. If the middleware or handler throws, the application catches it automatically and returns the response from the error handler, which can be customized with app.onError(). I think adding this doc is good. Can you check the comments?

Copy link
Copy Markdown
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Copy Markdown
Member

@alsuren

Thanks!

@yusukebe yusukebe merged commit 3abc313 into honojs:main Apr 11, 2025
codeOwlAI pushed a commit to codeOwlAI/website that referenced this pull request Jun 29, 2025
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