Skip to content

Commit

Permalink
Fixed P#45 - returning proper exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermann Romanek committed Apr 11, 2024
1 parent 034d8a9 commit 93057fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/sniffles/sniffles
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ if __name__ == "__main__":
try:
Sniffles2_Main(processes)
except (util.Sniffles2Exit, SystemExit) as exit_code:
# print(f'Sniffles exit with code {exit_code}')
if len(processes):
# Allow time for child process error messages to propagate
print("Sniffles2Main: Shutting down workers")
Expand All @@ -526,7 +525,7 @@ if __name__ == "__main__":
proc.process.join()
except:
pass
int_exit_code = exit_code.args[0]
exit(int_exit_code)
exit(exit_code.code)
except:
logging.getLogger('sniffles.main').exception(f'Unhandled error while running sniffles.')
exit(1)
2 changes: 1 addition & 1 deletion src/sniffles/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class Sniffles2Exit(Exception):
pass
code: int = 1


def stdev(nums):
Expand Down

0 comments on commit 93057fb

Please sign in to comment.