I found this code sample on one of the questions;
window.onerror = function (msg, url, linenumber) {
//make ajax call with all error details and log error directly into the elmah database
//show friendly error msg here to user
//hide error from browser
return true;
}
What does 'hide error from browser' means and how can I do that?
I didn't know such a thing exists and I give it a try with try-catch block. After an error occurred, I realized that browser still shows the error. How can I hide error from browser?
UPDATE
I tried following code and put that inside the head section of my all pages but noting happened;
<script type="text/javascript">
(function () {
window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
alert(errorMsg);
// Just let default handler run.
return true;
}
})();
</script>