Right now I’ve an exception in a promise catch clause from bs-axios
… that looks like this:
Axios.postData(...)
->Promise.then(response => {
Js.log("do cool things and stuff")
Promise.resolve(true)
->Promise.catch(error => {
Js.log(error)
// {"RE_EXN_ID": "Promise.JsError/2", "_1": [Error: Request failed with status code 429]}
Promise.resolve(false)
})
// {“RE_EXN_ID”: “Promise.JsError/2”, “_1”: [Error: Request failed with status code 429]}
The type on error is EXN not Js.Exn.t.
I read all the documentation I could about EXN rescript types and understand that there is a difference between Rescript Exceptions and JS Exceptions.
But what I don’t understand is how to extract any sort of meaning or usefulness from Rescript EXN, like an HTTP STATUS CODE or MESSAGE.
I’m not sure where else to look, so some help would be appreciated, thanks.