Skip to content

Instantly share code, notes, and snippets.

@thomasJang
Created January 27, 2019 06:15
Show Gist options
  • Save thomasJang/8dd7afcbbca5a77e9672c6e652a72936 to your computer and use it in GitHub Desktop.
Save thomasJang/8dd7afcbbca5a77e9672c6e652a72936 to your computer and use it in GitHub Desktop.
onerror.js
window.onerror = function (msg, url, lineNo, columnNo, error) {
const string = msg.toLowerCase(), substring = "script error";
if (string.indexOf(substring) > -1) {
axWarningDialog.alert('Script Error: See Browser Console for Detail');
} else {
sqlgate.api.call({
method: "POST",
data: JSON.stringify({
"url": url,
"message": msg,
"detail": JSON.stringify(error)
}),
url: "/api/v1/error",
callback: function (result) {
}
});
}
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment