raven-node
raven-node copied to clipboard
Cannot capture breadcrumbs without installing, cannot install without creating uncaughtException handler
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.
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 captureBreadcrumbwill 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".
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.
No worries, we can just repurpose this issue. Thanks for bringing this to my attention.