Fix basic auth by using HTTPException.getResponse() (#63)
authorStefan Gasser <redacted>
Mon, 26 Jan 2026 10:02:18 +0000 (11:02 +0100)
committerGitHub <redacted>
Mon, 26 Jan 2026 10:02:18 +0000 (11:02 +0100)
src/index.ts

index 2530a63628ed37a3300af898bf0b450104335ec1..e0035baa1c00564c32100df7ca1fdc885a0a798d 100644 (file)
@@ -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);
git clone https://git.99rst.org/PROJECT