summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveev <stargrave@stargrave.org>2019-04-21 17:20:53 +0300
committerSergey Matveev <stargrave@stargrave.org>2019-04-21 17:20:53 +0300
commit8f091a9be95e1581aaee100448660c3a59c6b6d2 (patch)
treeee173ac1b285fd5b08f1bca19855f70d25c86205
parentfbaccbc0fea90d1814c80621bdfa91fd1f74c7c5 (diff)
downloadpyderasn-8f091a9be95e1581aaee100448660c3a59c6b6d2.tar.xz
Include decode error in higher level one
-rwxr-xr-xpyderasn.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyderasn.py b/pyderasn.py
index 1c5b53f..2540654 100755
--- a/pyderasn.py
+++ b/pyderasn.py
@@ -3832,7 +3832,7 @@ class UTCTime(CommonString):
try:
value_decoded = value.decode("ascii")
except (UnicodeEncodeError, UnicodeDecodeError) as err:
- raise DecodeError("invalid UTCTime encoding")
+ raise DecodeError("invalid UTCTime encoding: %r" % err)
try:
self._strptime(value_decoded)
except (TypeError, ValueError) as err:
@@ -3977,7 +3977,7 @@ class GeneralizedTime(UTCTime):
try:
value_decoded = value.decode("ascii")
except (UnicodeEncodeError, UnicodeDecodeError) as err:
- raise DecodeError("invalid GeneralizedTime encoding")
+ raise DecodeError("invalid GeneralizedTime encoding: %r" % err)
try:
self._strptime(value_decoded)
except (TypeError, ValueError) as err: