I capture api errors like so
try {
…call api
} catch (e) {
Sentry.captureException(e);
}
but keep getting [object Response] and not the actual error.
Not sure what I am doing wrong here
I capture api errors like so
try {
…call api
} catch (e) {
Sentry.captureException(e);
}
but keep getting [object Response] and not the actual error.
Not sure what I am doing wrong here
The captureException
expects Error
type object as an argument. Looks like you’re passing a Response type object as an argument here.
You can try passing it as window.Sentry.captureException(new Error(e))
.
Thanks for the swift reply. Unfortunately this didn’t do the trick and still seeing [object Response], which is quite annoying. Happended after upgrading to the latest sentry browser version from 5.7.1.