Sha256: 7671db9a0a102dfb1f043e37911d3e27bdf98118a4e90385aab800946dbe223d

Contents?: true

Size: 841 Bytes

Versions: 10

Compression:

Stored size: 841 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 %>" + "/report_js_error", {
      data: err,
      type: "POST",
      cache: false
    });
  };
})();

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
logster-2.1.2 vendor/assets/javascripts/logster.js.erb
logster-2.1.0 vendor/assets/javascripts/logster.js.erb
logster-2.0.1 vendor/assets/javascripts/logster.js.erb
logster-2.0.0.pre vendor/assets/javascripts/logster.js.erb
logster-1.4.0.pre vendor/assets/javascripts/logster.js.erb
logster-1.3.4 vendor/assets/javascripts/logster.js.erb
logster-1.3.3 vendor/assets/javascripts/logster.js.erb
logster-1.3.2 vendor/assets/javascripts/logster.js.erb
logster-1.3.0 vendor/assets/javascripts/logster.js.erb
logster-1.3.pre vendor/assets/javascripts/logster.js.erb