@sentry/browser
@sentry/node
raven-js
raven-node
_(raven for node)_4.4.2
Hello,
My typescript validator throw me an error for captureException
method with a problem of argument. The type expect 1 argument, the error, but do not want the second argument data
.
Ex:
Sentry.captureException(new Error(msg), {
extra: {
...data,
},
})
error TS2554: Expected 1 arguments, but got 2.
Thanks
ps: I can make a _PR_ if you want.
The second argument is only supported in raven-js
/raven-node
from what I can see. You'll have to do something like this in @sentry/*
:
Sentry.withScope(scope => {
scope.setTag('tagName', 'tagValue')
scope.setExtra('extraName', 'extraValue')
Sentry.captureException(err)
})
@mogelbrod Provided the right answer, thanks :)
While we know this is more code to write we think this API is more clear and explicit.
Before the second was basically, pass an object in, "maybe" we pick it up and put in the event.
Closing this since it's not an actual bug.
Most helpful comment
The second argument is only supported in
raven-js
/raven-node
from what I can see. You'll have to do something like this in@sentry/*
: