So for over three days, I'm keep searching on how to get this error hidden from the console and respond to this error:
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
Error image in the Google Chrome's console, that I want to hide and handle
Neither official chrome documentation helps. https://developers.google.com/web/tools/chrome-devtools/console/track-exceptions
Nor any tricks that I came along on the google search.
The JavaScript that produces this ineventable error to occur
(For quick testing of the handling solution)
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
information: <div id="information" ></div>
<script>
var httpRequest = new XMLHttpRequest();
httpRequest.open("GET", "https://sdajfkljsdfk.lt", true);
httpRequest.onload = function (e) {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
console.log(httpRequest.responseText);
} else {
document.getElementById("information").innerHTML = "Error Unresponsive Domain";
}
}
};
httpRequest.send(null);
</script>
</body>
</html>