Closed kiaking closed 5 months ago
Thank you for summarizing! Generally LGTM.
One thing is that, it's more intuitive to use useError()
for getting the error itself or its wrapper object (cf. Nuxt's useError()
). Seeing what it does, useErrorReporter()
or useErrorCapturer
would match.
const reportError = useErrorReporter()
reportError(err)
const captureError = useErrorCapturer()
captureError(err)
Another thing is, it's good to unify how to reset the error or restore the page among our apps.
For example, Deus has restore button to reload the whole page while Fatima just shows some message.
Maybe SErrorPage
, I'm not so sure, though (cf. SPage
that we talked about before).
Last, would you elaborate the implementation of SErrorBoundary
?
We could use
<SErrorBoundary>
as alternative.
would you elaborate the implementation of
SErrorBoundary
?
https://github.com/globalbrain/sefirot/blob/main/lib/components/SErrorBoundary.vue -- it's same as Nuxt's one.
PS: Let's not use useError
as name. It might cause conflicts with Nuxt.
Ah, SErrorBoundary
is already released. 🙌
I couldn't catch up on all details of Sefirot releases these days.
Well, it looks exactly like SErrapPage
that I referred to in the last comment. 👍
Add error handling that works with Sentry. Maybe we need different module for Nuxt?
Currently, every app is doing slightly different things when catching and reporting global errors. Would be nice to have more unified way to setup.
Idea
In Vue, error can happen on many different phases, but at the moment, we only care about error happening when running the Vue app. We can ignore error happening outside of Vue, for example css file is not loaded due to network request kinda things.
Next, inside Vue app, we usually only care catching errors inside "page". In reality, error could happen at almost anywhere. Like
app.use()
can throw error if the plugin is messed up. But those errors are very rare and usually caught during local dev, at least for now, we can ignore it.So, ideally, I think having this kind of setup would make sense inside layout file.
The
useErrorHandling
composable should catch all errors and report to Sentry. How sentry is integrated should also be thought, but this is one ofuseErrorHandling
composable we have in our app.