#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

View File

@@ -29,6 +29,7 @@
- Fix field error message color
- [#433](https://github.com/estruyf/vscode-front-matter/issues/433): Fix issue with rendering an incorrect title value on the content dashboard
- [#462](https://github.com/estruyf/vscode-front-matter/issues/462): Fix issue in script error notification
## [8.1.2] - 2022-10-06

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`)) {