Skip to content

Instantly share code, notes, and snippets.

@scottillogical
Created September 5, 2014 15:25
Show Gist options
  • Save scottillogical/03f1470e956b510e5517 to your computer and use it in GitHub Desktop.
Save scottillogical/03f1470e956b510e5517 to your computer and use it in GitHub Desktop.
Errorception reuqirejs
define(function() {
'use strict';
return {
load: function() {
var key = "KEYHERE";
window._errs = [key];
var c = window.onerror;
window.onerror = function() {
var a = arguments;
window._errs.push(a);
c && c.apply(this, a);
};
var b = function() {
var c = document.createElement("script"),
b = document.getElementsByTagName("script")[0];
c.src = "//beacon.errorception.com/" + key + ".js";
c.async = !0;
b.parentNode.insertBefore(c, b);
};
b();
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment