We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 611b812 commit dbbf7a9Copy full SHA for dbbf7a9
src/app.ts
@@ -30,6 +30,7 @@ import {
30
segmentToMiddlewares,
31
} from "./segments.ts";
32
import { isHandlerByMethod, type PageResponse } from "./handlers.ts";
33
+import { STATUS_TEXT } from "@std/http/status";
34
35
// TODO: Completed type clashes in older Deno versions
36
// deno-lint-ignore no-explicit-any
@@ -66,7 +67,9 @@ const DEFAULT_ERROR_HANDLER = async <State>(ctx: Context<State>) => {
66
67
// deno-lint-ignore no-console
68
console.error(error);
69
}
- return new Response(error.message, { status: error.status });
70
+
71
+ const message = error.message || STATUS_TEXT[error.status];
72
+ return new Response(message, { status: error.status });
73
74
75
0 commit comments