From e542cb9a690ca1ccc61f9a2291f9a5691040c205 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 13 Jun 2023 09:52:13 -0500 Subject: [PATCH] Fail the script with an error instead of exit code --- scheduled-script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduled-script.js b/scheduled-script.js index 85a4dc1..f4d51e9 100644 --- a/scheduled-script.js +++ b/scheduled-script.js @@ -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.") }