Skip to content

Why can't I catch an error directly after install() ? #418

@prewk

Description

@prewk

Hi,

Given the following code:

window.onerror = err => console.error('Error caught:', err);
foo

The error will be caught with these messages in my console:

Error caught: Script error
Uncaught ReferenceError: foo is not defined

However, given this:

var Raven = require('raven-js');
Raven.config('https://[email protected]/31423').install();
foo

The error won't be noticed at all by Raven:

Uncaught ReferenceError: foo is not defined

I can confirm that .install() sets the window.onerror handler by looking at it before and after .install() is run.

Running: Raven.captureException(new Error('This is an error!')); after .install() does, however, log;

Raven about to send:
> Object { ........

So it seems able to capture through captureException, but not through window.onerror, am I missing something here? (Using Chrome & Webpack with babel)

I get that ReferenceError is often something you might not wanna look at, but it's explicitly included in the docs So I'm a bit confused if Raven always ignores those errors.

Thank you!

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