src/sap.ui.documentation/src/sap/ui/documentation/sdk/util/LiveEditorOutput.js
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);
		});
	}
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);
		});
	}
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 ) ; } ) ; }
Listen for errors and display them in the DOM,
so that the user does not need to open the console
Listen for errors and display them in the DOM so that the user does not need to open the console