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.

A "net::ERR_NAME_NOT_RESOLVED" error is not reported in Sentry

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.13.0

Description

I am initializing Sentry like this:

Sentry.init({
  dsn: <my sentry dsn>
});

And then in my code I force an error like this:

function reqListener () {
   console.log(this.responseText);
}
let oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "http://whiizzleee.commm/hahahahaha");
oReq.send();

This results in a “net::ERR_NAME_NOT_RESOLVED” error. I can see the error in the console, but Sentry is not reporting it.

I can see in the dev console, that the error is thrown at return originalSend.apply(this, args); in the trycatch.ts of sentry. Also in the network tab I do not see a request being sent to Sentry.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ghost23commented, Mar 11, 2020

I understand. OK, thank you for the explanations.

0reactions
kamilogorekcommented, Mar 11, 2020

Hmm, but isn’t the second example only caught, because of manually throwing the Error?

Yes, if code fails in any way there, eg. accessing null.foo it’d also catch it. The reason for wrapping vs. allowing it to bubble is that this way we have an access to the handler itself, it’s name, it’s event object etc. And not only error.

couldn’t you add yourself as a listener to the error and do a captureEvent by default?

We could, but in most cases it’d be simply way too noisy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No errors reported · Issue #6 · getsentry/sentry-react-native
1) and I'm trying to setup react-native-sentry I've configured according to the docs and everything seems to build and run fine, but no...
Read more >
Sentry not reporting any crashes
I recently integrated sentry into my expo react-native project. ... build that the test errors fire, but my actual crash is not reported....
Read more >
Integrate sentry in React Native project not working drop error ...
I want to integrate sentry tool for react native project crash report so below is my code import { AppRegistry } from 'react-native';...
Read more >
Sentry error reporting for Ember.js | Mainmatter - Simplabs
Are you confident that your apps have no bugs? Do you not need a support team because no user ever complains about something...
Read more >
Sentry Error Reporting By Example: Part 1 - codeburst
js: Used as a general purpose development tool; not part of the application. Used the latest (8.12.0) LTS version available; Sentry: A sentry...
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