Handle ENOENT exceptions with a graceful message

This commit is contained in:
Matthias Pigulla 2021-03-05 20:17:14 +00:00
parent 65d1ea3d90
commit 598c7ea894
2 changed files with 12 additions and 0 deletions

6
dist/index.js vendored
View file

@ -204,6 +204,12 @@ try {
}); });
} catch (error) { } catch (error) {
if (error.code == 'ENOENT') {
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.`);
console.log(`PATH is set to: ${process.env.PATH}`);
}
core.setFailed(error.message); core.setFailed(error.message);
} }

View file

@ -87,5 +87,11 @@ try {
}); });
} catch (error) { } catch (error) {
if (error.code == 'ENOENT') {
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.`);
console.log(`PATH is set to: ${process.env.PATH}`);
}
core.setFailed(error.message); core.setFailed(error.message);
} }