Created
January 27, 2019 06:15
-
-
Save thomasJang/8dd7afcbbca5a77e9672c6e652a72936 to your computer and use it in GitHub Desktop.
onerror.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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