deno.land / x / fresh@1.1.1 / src / server / default_error_page.ts

default_error_page.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { h } from "preact";import { DEBUG } from "./constants.ts";import type { ErrorPageProps } from "./types.ts";
export default function DefaultErrorPage(props: ErrorPageProps) { const { error } = props;
let message = undefined; if (DEBUG) { if (error instanceof Error) { message = error.stack; } else { message = String(error); } }
return h( "div", { style: { display: "flex", justifyContent: "center", alignItems: "center", }, }, h( "div", { style: { border: "#f3f4f6 2px solid", borderTop: "red 4px solid", background: "#f9fafb", margin: 16, minWidth: "300px", width: "50%", }, }, h("p", { style: { margin: 0, fontSize: "12pt", padding: 16, fontFamily: "sans-serif", }, }, "An error occured during route handling or page rendering."), message && h("pre", { style: { margin: 0, fontSize: "12pt", overflowY: "auto", padding: 16, paddingTop: 0, fontFamily: "monospace", }, }, message), ), );}
fresh

Version Info

Tagged at
a year ago