Two of every JavaScript error
INeedADip
Posted on
May 20 2014
Obviously I'm new to the service. Sorry if this is a duplicate question but I didn't see a way to search previous forum questions.
I just got an account and installed the JavaScript library. I made the call to Raygun.init(KEY).attach(), then threw an error to test it out.
I always see two errors logged for everything thrown. I double checked to make sure I'm not calling init() twice, so right now I'm a bit lost.
Any pointers would be greatly appreciated.
Callum
Posted on
May 21 2014
Are you using any libraries or frameworks that may contain custom error handling logic? One way to debug this would be to reference raygun.js (unminified), then set a breakpoint at line 1417 and inspect the stack trace to see where they are coming from. If it looks complicated post the stack traces of the two occurrences here or send it to me via email if it contains sensitive data: callum at mindscape dot co dot nz.
A further test that would be useful is to see if a duplicate error is sent by calling the following:
Raygun.send(Error('test error'))
INeedADip
Posted on
May 22 2014
Here are the two different stack traces:
Stack One:
- processUnhandledException raygun.js 1419
- notifyHandlers raygun.js 134
- traceKitWindowOnError raygun.js 186
Stack Two:
- processUnhandledException raygun.js 1419
- notifyHandlers raygun.js 134
- (anonymous function) raygun.js 224
- wrapped raygun.js 49
When I ran your test above I only got one error. When did my own quick test I just called a JavaScript method that doesn't exist: doesntExist();
Callum
Posted on
May 22 2014
What browser and version does this occur in, and is it repeatable in other browsers? Also, do you have a script or library that is adding a window.onerror handler of its own?
easy
Posted on
Oct 03 2014
I have same problem, 2 reports on every error
Callum
Posted on
Oct 03 2014
As above, could you please supply the browser(s) you're noticing this in, a snippet of how you have Raygun4JS setup (e.g the Init/Attach calls, plus any Raygun.Sends in catch { } blocks), any major third party libraries you're using such as Angular or anything else that may be calling window.onerror. I will take a look at this for you next week.
Regards,
Callum Gavin
Mindscape Limited