/Knowledge/sources/honojs__hono/llms-full/httpexception-throwing-httpexceptions-cause--bf0f26909eeb.md
HTTPException: Throwing HTTPExceptions > Cause - hono-docs
HTTPException: Throwing HTTPExceptions Cause Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt cause Sum...
HTTPException: Throwing HTTPExceptions > Cause
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#cause
Summary
In either case, you can use the cause option to add arbitrary data to the HTTPException. ```ts twoslash import { Hono, Context } from 'hono...
Content
In either case, you can use the cause option to add arbitrary data to the HTTPException.
import { Hono, Context } from 'hono'
import { HTTPException } from 'hono/http-exception'
const app = new Hono()
declare const message: string
declare const authorize: (c: Context) => Promise<void>
// ---cut---
app.post('/login', async (c) => {
try {
await authorize(c)
} catch (cause) {
throw new HTTPException(401, { message, cause })
}
return c.redirect('/')
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#cause",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / HTTPException > Throwing HTTPExceptions > Cause",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 614,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "HTTPException: Throwing HTTPExceptions > Cause",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}