Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

captureException or captureMessage drops off object info #1794

Closed
kishor-bhatt opened this issue Dec 12, 2018 · 3 comments
Closed

captureException or captureMessage drops off object info #1794

kishor-bhatt opened this issue Dec 12, 2018 · 3 comments

Comments

@kishor-bhatt
Copy link

This may be a newbie question but I want to add logs in captureMessage and captureException with JSON.stringify(API_responseObj).
The API_responseObj is trimmed off after some text in fingerprint & logentry message obj.
If same is added by console.log than message obj is having complete info, may be as logger is console.
Can you give a way where i can add a complete response object to Sentry log in string format without looping through all it's keys, something like JSON.stringify(OBJ) to print complete object.

Thanks.

@kamilogorek
Copy link
Contributor

Hey @kishor-bhatt, you can do this using extra context – https://docs.sentry.io/enriching-error-data/context/?platform=javascript

Sentry.withScope((scope) => {
  scope.setExtra("response", API_responseObj);
  Sentry.captureException(err);
});

@kishor-bhatt
Copy link
Author

kishor-bhatt commented Dec 12, 2018 via email

@kamilogorek
Copy link
Contributor

Anytime!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants