Sha256: 5ae968df9197f9227272633fed1384e99f483fdfa12f9f5f45c9a38f1a215414

Contents?: true

Size: 813 Bytes

Versions: 11

Compression:

Stored size: 813 Bytes

Contents

(function() {
  var lastReport = null;

  if (!window.Logster) {
    window.Logster = {
      enabled: true
    };
  }

  window.onerror = function(message, url, line, column, errorObj) {
    // never bother reporting more than once a minute
    if (lastReport && new Date() - lastReport < 1000 * 60) {
      return;
    }
    if (!Logster.enabled) {
      return;
    }

    lastReport = new Date();

    var err = {
      message: message,
      url: url,
      line: line,
      column: column,
      window_location: window.location && (window.location + "")
    };

    if (errorObj && errorObj.stack) {
      err.stacktrace = errorObj.stack;
    }

    $.ajax("<%= Logster.config.subdirectory || '/logs' %>" + "/report_js_error", {
      data: err,
      type: "POST",
      cache: false
    });
  };
})();

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
logster-0.8.3 vendor/assets/javascripts/logster.js.erb
logster-0.8.2 vendor/assets/javascripts/logster.js.erb
logster-0.8.1 vendor/assets/javascripts/logster.js.erb
logster-0.8.0 vendor/assets/javascripts/logster.js.erb
logster-0.1.8 vendor/assets/javascripts/logster.js.erb
logster-0.1.7 vendor/assets/javascripts/logster.js.erb
logster-0.1.6 vendor/assets/javascripts/logster.js.erb
logster-0.1.5 vendor/assets/javascripts/logster.js.erb
logster-0.1.4 vendor/assets/javascripts/logster.js.erb
logster-0.1.3 vendor/assets/javascripts/logster.js.erb
logster-0.1.2 vendor/assets/javascripts/logster.js.erb