Summary
Since it only includes a slight change in the feature, released as a patch-release.
Enable onError
of sub instances
This release enables onError
of sub instances attached by app.route()
.
const app = new Hono()
const sub = new Hono()
sub.get('/ok', async (c) => {
return c.text('ok')
})
sub.get('/error', () => {
throw new Error('This is Error')
})
sub.onError((_, c) => {
return c.text('onError by sub', 500)
})
app.route('/sub', sub)
If you access GET /sub/error
, it will return onError by sub
.
What's Changed
- feat: use added app's errorHandler by @usualoma in #871
- Revert "feat: use added app's errorHandler (#871)" by @yusukebe in #872
- feat: use added app's errorHandler with comose() by @usualoma in #874
Full Changelog: v2.7.6...v2.7.7