Skip to content

Commit

Permalink
fix: improve exit code error message
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed May 10, 2022
1 parent 7b65eae commit f1a5eb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,9 @@ export class Job<DATA = unknown | void> {
child.on('close', code => {
stillRunning = false;
if (code) {
console.log(`child process exited with code ${code}`);
reject(code);
const error = new Error(`child process exited with code: ${code}`);
console.warn(error.message);
reject(error);
} else {
resolve();
}
Expand Down

0 comments on commit f1a5eb8

Please sign in to comment.