Skip to content

Commit

Permalink
Fail the script with an error instead of exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud committed Jun 13, 2023
1 parent 8fc5afb commit e542cb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scheduled-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const date = new Date;
const minutes = date.getMinutes();

if(minutes < 30) {
process.exit(0)
console.log("Everything looks good here!")
} else {
process.exit(1)
throw new Error("This script fails when it runs after the half-hour.")
}

0 comments on commit e542cb9

Please sign in to comment.