Skip to content

Commit

Permalink
Now returns -1 when an uncaught exception is found.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Jul 7, 2020
1 parent 49bd2c9 commit f80e3f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ssh-audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
PROGRAM_RETVAL_WARNING = 2
PROGRAM_RETVAL_CONNECTION_ERROR = 1
PROGRAM_RETVAL_GOOD = 0
PROGRAM_RETVAL_UNKNOWN_ERROR = -1

try: # pragma: nocover
from colorama import init as colorama_init
Expand Down Expand Up @@ -3516,5 +3517,12 @@ def main() -> int:


if __name__ == '__main__': # pragma: nocover
exit_code = main()
exit_code = PROGRAM_RETVAL_GOOD

try:
exit_code = main()
except Exception:
exit_code = PROGRAM_RETVAL_UNKNOWN_ERROR
print(traceback.format_exc())

sys.exit(exit_code)

0 comments on commit f80e3f2

Please sign in to comment.