Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Cannot capture breadcrumbs without installing, cannot install without creating uncaughtException handler #307

Open
turpault-autodesk opened this issue Apr 25, 2017 · 3 comments

Comments

@turpault-autodesk
Copy link

When multiple instances of the Raven client are created through the Raven.Client() call, each single instance must be install()ed before the captureException/captureMessage calls.

However, install()ing the newly created client also installs the uncaughtException handler, which is not always the desired behaviour.

Installing the uncaughtException handler shall either be optional when install()ing the client, or install() should be made optional when captureMessage/Exception are called.

@LewisJEllis
Copy link
Contributor

LewisJEllis commented Apr 25, 2017

I'm not able to reproduce this as you're describing. The following file:

var Raven = require('raven');

var sentryDsn = '<sentry dsn>';
var r1 = new Raven.Client(sentryDsn);
var r2 = new Raven.Client(sentryDsn);

r1.captureException(new Error('did this capture r1?'));
r2.captureException(new Error('did this capture r2?'));

produces two events in Sentry for me. Can you provide more details on what you're observing?

The only two relevant things that should change when .install is called are:

  • the global process.on('uncaughtException') handler is added (should probably add an opt-out
  • captureBreadcrumb will start to actually record breadcrumbs (I don't immediately recall why it's still like this, might be able to have breadcrumbs recorded without install)

I'm interested in a potential repro of captureException/captureMessage not working without .install() since I can't repro that myself, but either way at the very least there's an action item here of "make it possible to capture breadcrumbs without installing a global exception handler".

@turpault-autodesk
Copy link
Author

My mistake, it was actually the breadcrumb that was not sent during the captureXX() call.

Do you want me to close this bug and open a new one ?

Again, sorry for the noise.

@LewisJEllis
Copy link
Contributor

No worries, we can just repurpose this issue. Thanks for bringing this to my attention.

@LewisJEllis LewisJEllis changed the title Not 'installing' the Raven Client prevents the processing of exceptions/messages Cannot capture breadcrumbs without installing, cannot install without creating uncaughtException handler Apr 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants