Skip to content

Instantly share code, notes, and snippets.

@trullock
Created September 3, 2012 08:33
Show Gist options
  • Save trullock/3607896 to your computer and use it in GitHub Desktop.
Save trullock/3607896 to your computer and use it in GitHub Desktop.
(function(){
var student, country, region;
bus.subscribe('student state changed', function(s) {
student = s;
});
bus.subscribe('country changed', function(c) {
country = c;
});
bus.subscribe('region changed', function(r) {
region = r;
});
try {
window.onerror = function (e, url, line) {
var browser = {};
for (var propertyName in window.navigator)
browser[propertyName] = window.navigator[propertyName]
var data = {
browser: browser
, country: country
, region: region
, student: student
, error: {
ex: e,
url: url,
line: line
}
};
$.ajax({
type: 'POST',
url: '/ajax/error',
data: data
});
};
}
catch (e) { }
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment