From 3b65c2217bfe73a23f10ee857252ca5226aebb98 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Tue, 20 Feb 2024 14:39:50 +0200 Subject: [PATCH] metadata API: Tweak exception message on sign failure I still don't know how we should handle failures in signing (maybe just let all of the weird exceptions raise instead of wrapping them) but this makes the wrapping error at least a bit more useful. Signed-off-by: Jussi Kukkonen --- tuf/api/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuf/api/metadata.py b/tuf/api/metadata.py index dadc51a6..ee37df91 100644 --- a/tuf/api/metadata.py +++ b/tuf/api/metadata.py @@ -384,7 +384,7 @@ def sign( try: signature = signer.sign(bytes_data) except Exception as e: - raise UnsignedMetadataError("Problem signing the metadata") from e + raise UnsignedMetadataError(f"Failed to sign: {e}") from e if not append: self.signatures.clear()