From fee1ba62abfaccccd178530a070624430ba64f59 Mon Sep 17 00:00:00 2001 From: Maximilian Zettler Date: Tue, 26 Sep 2023 09:06:31 +0200 Subject: [PATCH] do not exit in smart_punch function --- timebot/timebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timebot/timebot.py b/timebot/timebot.py index 8bc1b22..00c83bc 100644 --- a/timebot/timebot.py +++ b/timebot/timebot.py @@ -338,11 +338,11 @@ class TimeBot: method = "punch_out" elif last_punch[0]["entryNumber"] == PunchCodes.LEAVING.value: self.logger.error("your last entry was `punch_out`... punching in again with this command is not supported") - sys.exit(1) + raise Exception("your last entry was `punch_out`... punching in again with this command is not supported") if method is None: self.logger.error("hit an unknown situation... detection failed; run with `-v` for more info") self.logger.debug(f"last entry was: {last_punch}") - exit(1) + raise Exception("hit an unknown situation... method detection failed;") self.logger.info("running `{}` with date `{}` and time `{}`".format( method, punch_datetime.strftime(DateFormats.SIMPLE_DATE.value),