-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
If i understard correctly you can do something like this
try {
someOtherJSFunctionThatThrows()
} catch {
| Not_found => ... // catch a ReScript exception
| Invalid_argument(_) => ... // catch a second ReScript exception
| Js.Exn.Error(obj) => ... // catch the JS exception
}
In my case I have something like this
Axios.get("some_url", ())
->Promise.then(response => {
Promise.resolve(response.data)
})
->Promise.catch(exn => {
// exn is of type exn always, I need something like Js.Exn.t
Promise.reject(exn)
})
How to "cast" exn to Js.Exn.t ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels