Skip to content

Commit

Permalink
feat: log additional error data
Browse files Browse the repository at this point in the history
  • Loading branch information
iharthi committed Dec 16, 2024
1 parent f15baf1 commit a8fcdc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions esteid/idcard/signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ def setup(self, initial_data: dict = None):
try:
certificate = base64.b64decode(certificate_hex)
except binascii.Error as e:
logger.exception("Failed to decode certificate from DER encoding")
raise InvalidParameter(
"Failed to decode parameter `certificate` from DER encoding", param="certificate"
) from e

try:
self._certificate_handle = load_certificate(certificate)
except ValueError as e:
logger.exception("Failed to recognize `certificate` as a supported certificate format")
raise InvalidParameter(
"Failed to recognize `certificate` as a supported certificate format", param="certificate"
) from e
Expand Down

0 comments on commit a8fcdc8

Please # to comment.