Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit e7e3ca7

Browse files
committed
display puppet-lint errors as atom error notification
1 parent 69aa809 commit e7e3ca7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/main.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,20 @@ export default {
7474

7575
return helpers.exec(executablePath, args, { cwd: projectPath, ignoreExitCode: true })
7676
.then((output) => {
77-
// If puppet-lint errors to stdout then redirect the message to stderr so it is caught
77+
const toReturn = [];
78+
79+
// If puppet-lint errors to stdout then redirect the message to atom error notifications
7880
if (/puppet-lint:/.exec(output)) {
79-
throw output;
81+
atom.notifications.addError(
82+
'Puppet-Lint errored due to the following reason(s):',
83+
{
84+
detail: output,
85+
},
86+
);
87+
88+
// return early
89+
return toReturn;
8090
}
81-
const toReturn = [];
8291

8392
// Parse JSON output and immediately access zeroth element of redundant outer array
8493
const info = JSON.parse(output)[0];

0 commit comments

Comments
 (0)