Pulse7
9/10/2017 - 12:19 PM

Hooking to window error handling, alert instead of throwing

//show up to 3 error in alert
let onerror = {};
onerror.max = 3;
onerror.num = 0;
window.onerror = function(msg, file, line) {
	if (onerror.num++ < onerror.max) {
		alert("ERROR: " + msg + "\n" + file + ":" + line);
	}
}