Closed brc-dd closed 3 months ago
Name | Link |
---|---|
Latest commit | 4ecc14b18a20e6f953a0fa798b1e326f92e57e94 |
Latest deploy log | https://app.netlify.com/sites/sefirot-story/deploys/6603d60ce82a0500082b3fe6 |
Deploy Preview | https://deploy-preview-504--sefirot-story.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | 4ecc14b18a20e6f953a0fa798b1e326f92e57e94 |
Latest deploy log | https://app.netlify.com/sites/sefirot-docs/deploys/6603d60c687cca0008601e55 |
Deploy Preview | https://deploy-preview-504--sefirot-docs.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Since this is composable, should we place it under sefirot/lib/composables
? Or at least, useErrorHandler
function should be π
Another thing I'm curious is that, how would we integrate this with regular error handling?
For example, let's say we want to show global error in layout. I'm currently imagining to do something like this, but maybe there is a better way.
<script setup lang="ts">
// Not sentry, generic error handler.
import { useErrorHandling } from 'sefirot/composables/Error'
const { error } = useErrorHandling()
</script>
<template>
<div class="Layout">
<!-- Show error page if error is captured -->
<ErrorPage v-if="error" :error="error" />
<RouterView v-else="" />
</div>
</template>
// In `Error.ts`
function useErrorHandling() {
const error = ref<Error | null>(null)
onErrorCaptured((err) => {
// Not sure how to implement this but something like this?
if (err.statusCode === 404) {
error.value = new ErrorType(404)
}
// Prevent crushing error. How do we integrate Sentry?
// Like for some error, do not report to sentry etc. (ignore 404)
return false
})
return {
error
}
}
Ah, Iβll push useError code. See slack updates π
closes #476
Usage
Nuxt
useError / clearErrror / createError
Use Nuxt's builtins:
Vite
useError / clearErrror
createError