Blue screen of death when theres an error

This commit is contained in:
Eric Fredricksen
2021-12-15 11:04:03 -08:00
parent 7c97694a28
commit a1622ce802
3 changed files with 62 additions and 0 deletions
+16
View File
@@ -1156,13 +1156,29 @@ function ToDna(s) {
return r;
}
window.onerror = function(message, source, lineno, colno, error) {
$("#bsod_message").text(message);
$("#bsod_source").text(source);
$("#bsod_lineno").text(lineno);
$("#bsod_colno").text(colno);
$("#bsod_error").text(error.stack);
$("#bsodmom").show();
};
function FormKeyDown(e) {
$("#bsodmom").hide();
var key = String.fromCharCode(e.which);
if (key === 'd') {
alert("Your character's genome is " + ToDna(game.dna + ""));
}
// if (key === 'e') {
// simulateanerror();
// }
if (game.online) {
if (key === 'b') {
Brag('b', true);