Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch errors before loaded lib #1147

Closed
JosefJezek opened this issue Nov 23, 2017 · 1 comment
Closed

Catch errors before loaded lib #1147

JosefJezek opened this issue Nov 23, 2017 · 1 comment

Comments

@JosefJezek
Copy link

Does raven have solution for catch errors before installing as Google Analytics?

    // Initializes the analytics.js command queue.
    window.ga = window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;

    // Setup error tracking before anything else runs.
    window.onerror = function(message, file, lineNumber, columnNumber, error) {
      // We don't want to trigger any errors inside window.onerror, so wrap in a try/catch.
      try {
        // Some browsers don't support error param yet.
        if (error !== undefined) {
          message = error.stack;
        }
        ga('send', 'event', 'error', file + ':' + lineNumber, message);
      } catch (e) {
        // no-op
      }
    };
@kamilogorek
Copy link
Contributor

kamilogorek commented Jan 18, 2018

Not yet, but we'll work on this soon. Duplicate of #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants