Skip to content

Commit dbbf7a9

Browse files
fix
1 parent 611b812 commit dbbf7a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
segmentToMiddlewares,
3131
} from "./segments.ts";
3232
import { isHandlerByMethod, type PageResponse } from "./handlers.ts";
33+
import { STATUS_TEXT } from "@std/http/status";
3334

3435
// TODO: Completed type clashes in older Deno versions
3536
// deno-lint-ignore no-explicit-any
@@ -66,7 +67,9 @@ const DEFAULT_ERROR_HANDLER = async <State>(ctx: Context<State>) => {
6667
// deno-lint-ignore no-console
6768
console.error(error);
6869
}
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 });
7073
}
7174

7275
// deno-lint-ignore no-console

0 commit comments

Comments
 (0)