Skip to content

Commit

Permalink
nicer error handling for python vault
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Oct 30, 2024
1 parent d918ad3 commit 5cf90be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python-pyo3/python/p_vault/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@


def main():
# Override the script name in the arguments list so the Rust CLI works correctly
args = ["pvault"] + sys.argv[1:]
nitor_vault_rs.run(args)
try:
# Override the script name in the arguments list so the Rust CLI works correctly
args = ["pvault"] + sys.argv[1:]
nitor_vault_rs.run(args)
except KeyboardInterrupt:
print("\naborted")
exit(1)
except Exception as e:
print(f"Error: {e}")


if __name__ == "__main__":
Expand Down

0 comments on commit 5cf90be

Please sign in to comment.