Added notarize_no_exc method to return success state instead of raising the exception #5

Merged
Korulag merged 2 commits from albs-637 into master 2022-09-14 20:02:22 +00:00
Showing only changes of commit de5d91217f - Show all commits

View File

@ -84,6 +84,15 @@ class CasWrapper:
local_path: str,
metadata: typing.Dict = None,
) -> typing.Tuple[bool, str]:
"""
Wrapper for avoiding raising exceptions during notarization.
Return `success` flag instead for library user to react respectively.
:param local_path: path to a local Git repo
:param metadata: additional metadata
:return: boolean flag for operation success and the hash
of the notarized artifact.
:rtype: tuple
"""
success = False
try:
cas_hash = self.notarize(local_path, metadata=metadata)