Closed coleman-benja closed 4 years ago
Hey! Even if you define "onError", it still throws an exception. This is done so that you can still react to single actions outside of Vapi. At the moment you have to do the whole thing with an error handling. But it would be an idea to include this in version 3.
try {
// success
const params = { id: 42 }
const data = { content: "foo" }
await this.actionName({ params, data })
} catch (error) {
// error
}
Alternatively use then() and catch().
Ah wasn't sure if it was intended or not, thank you!
You're welcome! I'll put that in the documentary. That information is definitely missing.
Hello!
I'm having an issue where rejected promises are being thrown, despite defining an
onError
handler.I'm passing Vapi an instance of Axios that has an interceptor defined like so:
and instancing Vapi a la:
onError
is being called, however it's still reportingUncaught (in promise) Error
. I'm wondering how these could be handled? If I don't returnPromise.reject(error)
in the interceptor it doesn't triggeronError
, but somehow it's still not considered being caught.