question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error message property logged as [object ErrorEvent]

See original GitHub issue

Do you want to request a feature or report a bug? Bug.

What is the current behavior? Sometimes (not always) the message property of the error is logged as [object ErrorEvent]. I followed the standard implementation of Raven in Angular as described here: https://docs.sentry.io/clients/javascript/integrations/angular/.

What is the expected behavior? To see a normal error message.

Raven 3.17.0 Angular 4.3.1 Webpack build Not using CLI CDN version

objecterrorevent

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:31 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
GEMIcommented, Dec 1, 2017

Hi, I am getting a lot of these errors [object Object]. screenshot 2017-12-01 09 41 20

Angular 4 Chrome 62.0.3202 Raven-js 3.20.1

4reactions
shcallawaycommented, Oct 13, 2017

I found the issue. ErrorEvent is not being treated as an error by the isError util function, which can be found here. For convenience, I’ll paste the function definition also:

function isError(value) {
  switch ({}.toString.call(value)) {
    case '[object Error]':
      return true;
    case '[object Exception]':
      return true;
    case '[object DOMException]':
      return true;
    default:
      return value instanceof Error;
  }
}

I did a quick test in my console to see whether or not this function would return true for an ErrorEvent, and it did not:

image

isError is used in the captureException method to determine whether the exception parameter is an error or simply a message. captureException will send exceptions to the dashboard using captureMessage if it thinks the exception is not actually an error. In this case, Raven will not compute a stack trace or “process” the exception. It just sends it off as is.

Is there any reason we shouldn’t update isError to return true for ErrorEvent objects?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I debug a "[object ErrorEvent] thrown" error in my ...
I'm having the same issue and the only info I have to go on is the message: An error was thrown in afterAll....
Read more >
ErrorEvent - Web APIs - MDN Web Docs - Mozilla
desktop desktop Chrome Edge ErrorEvent Full support. Chrome10. Toggle history Full support. Edge12. Togg... ErrorEvent() constructor Full support. Chrome16. Toggle history Full support. Edge14. Togg...
Read more >
[object ErrorEvent] thrown … again
I keep seeing this error while trying to write Angular tests. ... in a try/catch and logging the error actually helps a great...
Read more >
Serialization Error Handling
Error handling is defined through two methods: the Error event on ... Error += delegate(object sender, ErrorEventArgs args) { // only log an...
Read more >
Analytics error codes - Firebase - Google
Error Code Cause Value 4 Event parameter value is too long Name of invalid parameter 5 Event has more than 25 parameters None 7 User property...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found