Skip to content

No console errors shown if unhandled error occured #2336

@maxaon

Description

@maxaon

Package + Version

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

Version:

@sentry/browser 5.9.0 and later

Description

All unhandled errors are logged to sentry but not shown in console. Because of this issue it's impossible to now where error occurs when console is opened
Example code:

<script
  src="https://browser.sentry-cdn.com/5.9.1/bundle.min.js"
  integrity="sha384-/x1aHz0nKRd6zVUazsV6CbQvjJvr6zQL2CHbQZf3yoLkezyEtZUpqUNnOLW9Nt3v"
  crossorigin="anonymous"
></script>
<script>
  Sentry.init({
    dsn: "https://[email protected]/1208645"
  });
  setTimeout(() => {
    throw new Error("Demo error");
  }, 10);
</script>

Expected result: Error is shown in console and reported to sentry.
Actual result: Error not shown in console and reported to sentry.

This issue was introduced when returning true from onerror handler. This was changed in this commit:
d716bd9

Demo page: https://jsbin.com/rumugequke

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions