File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def strip_pkcs5_padding(data):
70
70
return stripped
71
71
72
72
@staticmethod
73
- def read_pem_file (key_file_path ):
73
+ def read_pem_file (key_file_path , error_source = None ):
74
74
try :
75
75
key_file_path = expanduser (key_file_path )
76
76
@@ -80,6 +80,8 @@ def read_pem_file(key_file_path):
80
80
with open (key_file_path , "rb" ) as pem_file :
81
81
return Crypto (pem_file .read ().strip ())
82
82
except (AttributeError , IOError , TypeError , OSError ) as exc :
83
- error = "Could not read private key file: '{0}'" .format (key_file_path )
83
+ error = "Could not read private key file: '{0}', passed as: {1}" .format (
84
+ key_file_path , error_source
85
+ )
84
86
exception = "{0}: {1}" .format (type (exc ).__name__ , exc )
85
87
raise RuntimeError ("{0}: {1}" .format (error , exception ))
You can’t perform that action at this time.
0 commit comments