-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror.vue
39 lines (30 loc) · 866 Bytes
/
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
<script setup lang="ts">
import type { NuxtError } from '#app';
const props = defineProps<{
error: NuxtError;
}>();
const pageNotFound = computed(() => {
return props.error.statusCode === 404;
});
const isMaintenanceMode = computed(() => {
return props.error.statusCode === 503 && props.error.statusMessage === 'MAINTENANCE_MODE';
});
const genericServerError = computed(() => {
return props.error.statusCode >= 500;
});
</script>
<template>
<NuxtLoadingIndicator />
<template v-if="pageNotFound">
<ErrorNotFound />
</template>
<template v-else-if="isMaintenanceMode">
<ErrorMaintenance />
</template>
<template v-else-if="genericServerError">
<ErrorServer :error="props.error" />
</template>
<template v-else>
<ErrorUnknown :error="props.error" />
</template>
</template>