Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created March 20, 2013 14:44
Show Gist options
  • Save pschyska/5205194 to your computer and use it in GitHub Desktop.
Save pschyska/5205194 to your computer and use it in GitHub Desktop.
// Legacy cm.e support
if (cm.e) {
snippetNeedsUpdating = true;
// Process queued errors
for (var i=0; i < cm.e.length; i+=1) {
cm.onerror.apply(this, cm.e[i]);
}
// Override push to immediately call onerror
cm.e.push = function(message, file, line, column) {
cm.onerror(message, file, line, column);
};
}
window._crashmat = {
key: "mj8c",
// TODO: find a way to get the environment without using sencha,
// otherwise we can't report errors during loading
env: bp.config.Main.env,
debug: true
};
(function(w, d, cm, woe) {
w.onerror = function(e,f,l,c) {
debugger;
cm.e = cm.e || []; cm.e.push([e,f,l,c]);
if (woe) woe(e,f,l,c);
};
var e = d.createElement('script');
e.async = true;
e.src = 'https://db2uk9yp28y61.cloudfront.net/';
(d.head || d.getElementsByTagName('head')[0]).appendChild(e);
})(window, document, window._crashmat, window.onerror);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment