/Knowledge/sources/honojs__hono/llms-full/context-error--ac401a517c8c.md
Context: error - hono-docs
Context: error Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt error Summary If the Handler throws an...
Context: error
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#error
Summary
If the Handler throws an error, the error object is placed in c.error. You can access it in your middleware. ```ts twoslash import { Hono } from 'hono' const app = new Hono() // ---cut--- app.use(async (c, next) => { await next() if (c...
Content
If the Handler throws an error, the error object is placed in c.error.
You can access it in your middleware.
import { Hono } from 'hono'
const app = new Hono()
// ---cut---
app.use(async (c, next) => {
await next()
if (c.error) {
// do something...
}
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#error",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Context > error",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 567,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Context: error",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}