More reliable error message for ScriptDeaths

This commit is contained in:
Snarling 2022-08-29 03:31:30 -04:00
parent ad356cf28f
commit caf1a99c1d

@ -23,9 +23,9 @@ export function errorDialog(e: unknown, initialText = "") {
console.error(e);
}
if (!initialText) {
if (e instanceof ScriptDeath) initialText = `${e.name}@${e.hostname} (PID - ${e.pid})\n\n`;
if (!initialText && e instanceof ScriptDeath) {
const basicHeader = `ERROR\n${e.name}@${e.hostname} (PID - ${e.pid})\n\n`;
if (e.errorMessage.includes(basicHeader)) initialText = basicHeader;
}
dialogBoxCreate(initialText + errorText);
}