In JavaScript, we’re doing
foo.then(
(bar) => { /* yay success */ },
(error) => { Raven.captureException(error) }
)
and the message that ends up showing is [object Object]
.
Given that local variables aren’t captured, this leaves us in the dark.
Digging in a little bit, it looks like raven-js is in the branch of captureException where it thinks our exception doesn’t match isError
, so we have some work to do, but . . .
- Sentry could be more explicit about this, say “hey, you should be using the SDK differently, use captureMessage instead”
- It’s also possible I want to do something differently where that error originated so that it is an Error object? But
[object Object]
doesn’t give me much to go on, I’m not sure if that object was one I constructed or if it’s something from AngularJS, etc. So ifobject
doesn’t have a usefultoString
, can raven-js provide one?