Closed
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
5.0.6
Description
I'm not sure if this is a bug or a lack of clear documentation.
The following code is a slightly modified snipped taken from https://docs.sentry.io/enriching-error-data/scopes/?platform=javascript
Sentry.addBreadcrumb({ message: 'My Breadcrumb' });
Sentry.withScope(scope => {
scope.setTag("my-tag", "my value");
scope.setLevel('warning');
scope.addBreadcrumb({ message: 'scope breadcrumb' });
// will be tagged with my-tag="my value"
Sentry.captureException(new Error('oops!'));
});
Running the following code
will result in an isse with only 2 breadcrums:
- generic | My Breadcrumb
- exception | Error: oops!
I would expect to see the scope breadcrumb
on the list of breadcrums. How can I capture an exception within a local scope, so that scope breadcrumbs are also reported?
Metadata
Metadata
Assignees
Labels
No labels