Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Dec 17, 2024
1 parent d0a5660 commit a2464d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions linupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def main():
try:
# Handle Ctrl+C (KeyboardInterrupt)
signal.signal(signal.SIGINT, signal.default_int_handler)
signal.signal(signal.SIGTERM, signal.default_int_handler)

# Get current date and time
todaydatetime = datetime.now()
Expand Down Expand Up @@ -135,7 +134,7 @@ def main():
exit_code = 1

# If the user presses Ctrl+C or the script is killed, do not send an email and exit with code 2
except (KeyboardInterrupt, SystemExit):
except KeyboardInterrupt as e:
send_mail = False
exit_code = 2

Expand Down
12 changes: 3 additions & 9 deletions src/controllers/Args.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ def parse(self):

# Catch exceptions
# Either ArgsException or Exception, it will always raise an ArgsException to the main script, this to avoid sending an email when an argument error occurs
except ArgsException as e:
raise ArgsException(str(e))
except Exception as e:
except (ArgsException, Exception) as e:
raise ArgsException(str(e))

try:
Expand Down Expand Up @@ -595,9 +593,7 @@ def parse(self):

# Catch exceptions
# Either ArgsException or Exception, it will always raise an ArgsException to the main script, this to avoid sending an email when an argument error occurs
except ArgsException as e:
raise ArgsException(str(e))
except Exception as e:
except (ArgsException, Exception) as e:
raise ArgsException(str(e))


Expand Down Expand Up @@ -849,7 +845,5 @@ def help(self):

# Catch exceptions
# Either ArgsException or Exception, it will always raise an ArgsException to the main script, this to avoid sending an email when an argument error occurs
except ArgsException as e:
raise ArgsException('Printing help error: ' + str(e))
except Exception as e:
except (ArgsException, Exception) as e:
raise ArgsException('Printing help error: ' + str(e))

0 comments on commit a2464d5

Please sign in to comment.