55919 form editor error boundary (#494)

* fix password reset bug

* form editor error boundary

* fix crisp

* fix layout on create and edit pages

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka
2024-07-17 15:07:19 +01:00
committed by GitHub
parent a2c1757815
commit f4386fbcbc
7 changed files with 145 additions and 30 deletions

View File

@@ -0,0 +1,30 @@
<template>
<slot v-if="!error" />
<slot
v-else
name="error"
:error="error"
:clear-error="clearError"
/>
</template>
<script setup lang="ts">
const error = ref()
const emit = defineEmits(['on-error'])
function clearError() {
error.value = undefined
}
onErrorCaptured(err => {
error.value = err
emit('on-error', err)
return false
})
const route = useRoute()
watch(
() => route.fullPath,
() => {
error.value = undefined
}
)
</script>