Ability to catch all errors like errorCaptured #2471
-
I'm trying to set up global error handling in my app, which I can partially accomplish with errorCaptured. Unfortunately, this does not catch any errors that are thrown from Pinia... or rather, I might not know how to tie into it. Is there something like this that exists in Pinia? I know I can add an interceptor in axios or whatever request library, but it's possible that the error occurs before or after the request. Basically in this example, I'd like to show the Pinia errors in the Errors heading below the components. The error is being thrown from the stores/test file, which does not get caught by errorCaptured. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I may have figured it out... I need to tap into both error and unhandledrejection. The latter is to handle promises and the former is for everything else... I would've needed the latter because errorCaptured does not actually capture promise errors, which is the majority of what I need to catch. |
Beta Was this translation helpful? Give feedback.
I may have figured it out... I need to tap into both error and unhandledrejection. The latter is to handle promises and the former is for everything else... I would've needed the latter because errorCaptured does not actually capture promise errors, which is the majority of what I need to catch.