code: function addOnErrorHook () {
  
  		window.addEventListener("error", function(error) {
  			error.preventDefault();
  			var oErrorOutput = document.createElement("span");
  			oErrorOutput.innerText = error.message; // use save API
  			oErrorOutput.style.cssText = "position:absolute; top:1rem; left:1rem";
  			if (!document.body) {
  				document.write("<span></span>"); // add content via document.write to ensure document.body is created;
  			}
  			document.body.appendChild(oErrorOutput);
  		});
  	}
docs: Listen for errors and display them in the DOM,
  so that the user does not need to open the console