#462 - Fix issue in script error notification

This commit is contained in:
Elio Struyf
2022-11-14 10:40:30 +01:00
parent 78587509b3
commit b54eb5a360
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -195,7 +195,11 @@ export class CustomScript {
const output = await CustomScript.executeScript(script, wsPath, `"${wsPath}" "${contentPath}" ${articleData}`);
return output;
} catch (e) {
Notifications.error(`${script.title}: ${(e as Error).message}`);
if (typeof e === "string") {
Notifications.error(`${script.title}: ${e}`);
} else {
Notifications.error(`${script.title}: ${(e as Error).message}`);
}
return null;
}
}
@@ -285,6 +289,7 @@ export class CustomScript {
exec(fullScript, (error, stdout) => {
if (error) {
reject(error.message);
return;
}
if (stdout && stdout.endsWith(`\n`)) {