-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
feature requestfixed on 4.xThis issue has been already fixed on the v4 but exists in v3This issue has been already fixed on the v4 but exists in v3has workaround
Description
Version
3.0.3
Reproduction link
https://jsfiddle.net/orzwg537/
Steps to reproduce
Run the fiddle and look in console
What is expected?
a message saying error caught
What is actually happening?
There is an Unhandled Promise rejection instead
Currently, errors thrown in guards are caught by router.onError but Promises rejections (or error thrown in an async
function) are not caught. This should be handled in all the other guards as well. To handle them right now it is possible by passing the error to next
:
try {
await fetchdata()
} catch (error) {
next(error)
}
HcySunYang, ducmerida and merlosy
Metadata
Metadata
Assignees
Labels
feature requestfixed on 4.xThis issue has been already fixed on the v4 but exists in v3This issue has been already fixed on the v4 but exists in v3has workaround