Skip to content

Commit 598c7ea

Browse files
committed
Handle ENOENT exceptions with a graceful message
1 parent 65d1ea3 commit 598c7ea

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

dist/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ try {
204204
});
205205

206206
} catch (error) {
207+
208+
if (error.code == 'ENOENT') {
209+
console.log(`The '${error.path}' executable could not be found. Please make sure it is on your PATH and/or the necessary packages are installed.`);
210+
console.log(`PATH is set to: ${process.env.PATH}`);
211+
}
212+
207213
core.setFailed(error.message);
208214
}
209215

index.js

+6
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,11 @@ try {
8787
});
8888

8989
} catch (error) {
90+
91+
if (error.code == 'ENOENT') {
92+
console.log(`The '${error.path}' executable could not be found. Please make sure it is on your PATH and/or the necessary packages are installed.`);
93+
console.log(`PATH is set to: ${process.env.PATH}`);
94+
}
95+
9096
core.setFailed(error.message);
9197
}

0 commit comments

Comments
 (0)