How to pass extra data via captureException/captureMessage in latest sdk

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

4.0.6

Description

We can put a extra data in captureException / captureMessage when we use raven-js. Raven.captureException(err, extra)

How is that supported in latest sdk ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:42
  • Comments:28 (8 by maintainers)

github_iconTop GitHub Comments

55reactions
artemvcommented, May 13, 2020

And the majority conclusion was that it’s much more flexible and easier to maintain this way.

Hey guys, this does look ridiculous. Did you see competitors’ API?

Rollbar.error("Something went wrong", e, {postId: 123}); //sending a message, exception and additional payload together
Rollbar.info("Post published", {postId: 123}); //sending a message with payload
Rollbar.error("Something went wrong"); //simple message is fine too
40reactions
Nabellaleencommented, Oct 1, 2018

Yeah, I’ve sound the same solution, but indeed, it’s less sexy

            Sentry.withScope(scope => {
              scope.setExtra("state", state)
              scope.setExtra("data", data)
              Sentry.captureException(data.exception)
            });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Usage | Sentry Documentation
Capturing Errors You can use captureException to manually report errors: The ... These types of extra context data are detailed more under Additional...
Read more >
minimal | Sentry JavaScript SDKs - v5.21.1
Set an object that will be merged sent as extra data with the event. Parameters. extras: Extras. Extras object to merge into current...
Read more >
What is the equivalent of passing an extra's dictionary to ...
Using both the python logging integration and capture_exception is close... except Exception as e: logging.error(e, exc_info=True, extra=extra) ...
Read more >
JavaScript - Docs - Sentry Documentation
You can also add the Sentry SDK as a dependency using npm: ... size - There are times, when you may want to...
Read more >
sentry - Go Packages
Do not call Flush indiscriminately after every call to CaptureEvent, CaptureException or CaptureMessage. Instead, to have the SDK send events over the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found