From: Stefan Gasser Date: Mon, 26 Jan 2026 10:02:18 +0000 (+0100) Subject: Fix basic auth by using HTTPException.getResponse() (#63) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=1b406996cc9359b97b342bcb8e2c317a64ef15e6;p=sgasser-llm-shield.git Fix basic auth by using HTTPException.getResponse() (#63) --- diff --git a/src/index.ts b/src/index.ts index 2530a63..e0035ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,15 +66,7 @@ app.notFound((c) => { app.onError((err, c) => { if (err instanceof HTTPException) { - return c.json( - { - error: { - message: err.message, - type: err.status >= 500 ? "server_error" : "client_error", - }, - }, - err.status, - ); + return err.getResponse(); } console.error("Unhandled error:", err);