python-tuf/tuf/api
Martin Vrachev 896e552fd7 sign sslib.exceptions -> UnsignedMetadataError
Catch Metadata.sign() securesystemslib exceptions and instead throw
a more general UnsignedMetadataError exception.
We don't want to expose securesystemslib exceptions and it's better
to replace them with a more general exception that could be easily
handled.

As the signer is an argument implementing securesystemslib.signer.Signer
interface we don't know what exception will it throw.
That's why we need to catch all possible exceptions during signing and
raise UnsignedMetadataError.
That is the same reason why we should move the serialization outside
the "try" block, so a tuf.api.serialization.SerializationError can
propagate and warn the user that 'signed' cannot be serialized.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-01-27 17:31:02 +02:00
..
serialization Make (De)SerializationError a RepositoryError 2022-01-19 16:52:19 +02:00
__init__.py tuf/api: Expose tuf.api as a package 2020-10-15 14:35:14 +01:00
exceptions.py sign sslib.exceptions -> UnsignedMetadataError 2022-01-27 17:31:02 +02:00
metadata.py sign sslib.exceptions -> UnsignedMetadataError 2022-01-27 17:31:02 +02:00