From f8f1991dfb5920ce6755029991c9a69dc7884a98 Mon Sep 17 00:00:00 2001 From: Jannis Date: Sun, 29 Mar 2026 17:53:31 +0200 Subject: [PATCH] Update Error Handling Section Added typing for parsed.status to match Hono's required ContentfulStatusCode and prevent typing errors. --- apps/docs/content/2.frameworks/08.hono.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/2.frameworks/08.hono.md b/apps/docs/content/2.frameworks/08.hono.md index a94535b..f5449b8 100644 --- a/apps/docs/content/2.frameworks/08.hono.md +++ b/apps/docs/content/2.frameworks/08.hono.md @@ -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) @@ -137,7 +139,7 @@ app.onError((error, c) => { fix: parsed.fix, link: parsed.link, }, - parsed.status, + parsed.status as ContentfulStatusCode, ) }) ```