Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/docs/content/2.frameworks/08.hono.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ app.get('/checkout', (c) => {
Handle errors globally with `app.onError` to return structured JSON responses:

```typescript [src/index.ts]
import type { ContentfulStatusCode } from 'hono/utils/http-status'

app.onError((error, c) => {
c.get('log').error(error)
const parsed = parseError(error)
Expand All @@ -137,7 +139,7 @@ app.onError((error, c) => {
fix: parsed.fix,
link: parsed.link,
},
parsed.status,
parsed.status as ContentfulStatusCode,
)
})
```
Expand Down
Loading