Skip to content

Commit

Permalink
error log to help migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 30, 2024
1 parent f59bebc commit 364f3a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion poorman_handshake/asymmetric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def __init__(self, path: str = None, key_size: int = 2048):
key_size (int, optional): Size of the RSA key in bits (default is 2048).
"""
if path and isfile(path):
self.load_private(path)
try:
self.load_private(path)
except ValueError:
print(f"file does not look like a valid RSA key, please delete it and try again. '{path}'")
raise
else:
self.private_key = RSA.generate(key_size)
if path:
Expand Down

0 comments on commit 364f3a6

Please sign in to comment.