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); console.error(e);
} }
if (!initialText) { if (!initialText && e instanceof ScriptDeath) {
if (e instanceof ScriptDeath) initialText = `${e.name}@${e.hostname} (PID - ${e.pid})\n\n`; const basicHeader = `ERROR\n${e.name}@${e.hostname} (PID - ${e.pid})\n\n`;
if (e.errorMessage.includes(basicHeader)) initialText = basicHeader;
} }
dialogBoxCreate(initialText + errorText); dialogBoxCreate(initialText + errorText);
} }