fix: Use custom 500 page for *all* handlers if present (#1362)

This commit is contained in:
Kamil Ogórek
2023-06-27 11:05:05 +02:00
committed by GitHub
parent ee3e4a1145
commit aff31c0f15
8 changed files with 108 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
import { ErrorPageProps } from "../../../server.ts";
export default function Error500Page({ error }: ErrorPageProps) {
return <p class="custom-500">Custom 500: {(error as Error).message}</p>;
}
@@ -0,0 +1,7 @@
import { Handlers } from "../../../server.ts";
export const handler: Handlers = {
GET(_req, ctx) {
throw new Error("Pickle Rick!");
},
};