-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
68 lines (62 loc) · 1.49 KB
/
error.vue
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
60
61
62
63
64
65
66
67
68
<template>
<div class="errorPage">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="errorImage"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"
/>
</svg>
<h1 class="headline">Error {{ error.statusCode }}</h1>
<p v-if="error.message || error.statusMessage" class="statusMessage">
{{ error.statusMessage || error.message }}
</p>
<div class="stackTraceContainer">
<div v-if="error.stack" v-html="error.stack" />
<div v-else>We don't know anything more about this error.</div>
</div>
<div class="buttons">
<a class="button" href="/">Back to Homepage</a>
</div>
</div>
</template>
<script setup lang="ts">
defineProps<{
error: {
statusCode: number
message?: string
statusMessage?: string
stack?: string
}
}>()
</script>
<style lang="css" scoped>
.errorImage {
@apply mx-auto h-12 w-12;
}
.errorPage {
@apply flex h-full min-h-screen flex-col items-center justify-center p-4;
}
.headline {
@apply text-center text-4xl font-bold;
}
.statusMessage {
@apply text-center;
}
.buttons {
@apply flex justify-center py-4;
}
.button {
@apply border border-black p-2 hover:bg-gray-200;
}
.stackTraceContainer {
@apply my-6 max-h-96 max-w-2xl overflow-auto border border-red-800 bg-red-200 p-4;
}
</style>