Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

bugsnag catches should.js asserts #37

Closed
matejkramny opened this issue Sep 13, 2014 · 2 comments
Closed

bugsnag catches should.js asserts #37

matejkramny opened this issue Sep 13, 2014 · 2 comments

Comments

@matejkramny
Copy link

As part of node.js testing, mocha and should.js throw exceptions when something fails..

That is expected, apart from the fact that bugsnag tries to catch them :P.

Is it possible to disable bugsnag entirely, while not having to comment out all the require('bugsnag') lines?

I tried setting the bugsnag like this:

bugsnag.register({
    apiKey: 'a key',
    notifyReleaseStages: ["production"],
    releaseStage: 'development',
    autoNotify: false,
    onUncaughtError: function () {}
});

It still catches the errors, which is really annoying.

I temporarily added return statements to each bugsnag function, which helped.

@ConradIrwin
Copy link
Contributor

Hey @matejkramny,

Sorry for the slow reply.

In our tests we do this, which helps for cases where we are manually catching and sending to bugsnag. Hopefully that will work for you too.

require('bugsnag').notify = function (e) {
  throw e;
}

Usually this isn't a problem, as the test runner catches errors first. But sometimes in async callbacks this comes in handy.

@matejkramny
Copy link
Author

Hi Conrad, thanks for looking at this and fixing it. Interesting behaviour
hehe

On Thursday, February 19, 2015, Conrad Irwin notifications@github.com
wrote:

Hey @matejkramny https://github.com/matejkramny,

Sorry for the slow reply.

In our tests we do this, which helps for cases where we are manually
catching and sending to bugsnag. Hopefully that will work for you too.

require('bugsnag').notify = function (e) {
throw e;
}

Usually this isn't a problem, as the test runner catches errors first. But
sometimes in async callbacks this comes in handy.


Reply to this email directly or view it on GitHub
#37 (comment).

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