exception caused by an app that is not handled by TVDOS will now print out stack trace before causing the computer to shut down

This commit is contained in:
minjaesong
2022-05-26 20:31:34 +09:00
parent b79278bdf3
commit 9aaa7689ed
3 changed files with 107 additions and 2 deletions

View File

@@ -397,7 +397,20 @@ var execApp = (cmdsrc, args) => {
`var _appStub=function(exec_args){${injectIntChk(cmdsrc, intchkFunName)}\n};` +
`_appStub`); // making 'exec_args' a app-level global
return execAppPrg(args);
try {
execAppPrg(args);
}
catch (e) {
printerrln(
`
\\|/ ____ \\|/
"@'/ ,. \\'@"
/_| \\__/ |_\\
\\__U_/
Kernel panic - ${e.stack}`
)
serial.printerr(e.stack)
}
}
///////////////////////////////////////////////////////////////////////////////

View File

@@ -377,7 +377,10 @@ shell.coreutils = {
let contents = filesystem.readAll(CURRENT_DRIVE);
// TODO just print out what's there
print(contents);
}
},
/*panic: function(args) {
throw Error("Artificial Kernel Panic Triggered")
}*/
};
shell.coreutils.chdir = shell.coreutils.cd;
Object.freeze(shell.coreutils);