coming from Axios?
For other errors I can do something like:
error instanceof ReferrenceError
But how to detect if it's axios?
Wrap the axios function in something that catches and assigns .axios = true to the error object, then re-throws the error
Axios will return a promise , so you can catch it axios.post(...).then(...).catch(...);
What's the use-case?
Обсуждают сегодня