Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_internal.tuf: exception handling #357

Closed
jku opened this issue Dec 22, 2022 · 1 comment · Fixed by #525
Closed

_internal.tuf: exception handling #357

jku opened this issue Dec 22, 2022 · 1 comment · Fixed by #525
Labels
component:tuf TUF related components enhancement New feature or request

Comments

@jku
Copy link
Member

jku commented Dec 22, 2022

#351 is going to add sigstore._internal.tuf module. It does not handle errors consistently at the moment.

@woodruffw on error handling:

sigstore-python needs some exception refactoring anyways, and we could probably do a better job with the overall refactor by batching any handling here into those changes.

In that light, I'll just document the current sigstore._internal.tuf.TrustUpdater situation here:

  • constructors may raise
    • OSError on file read/write errors
  • TrustUpdater.get_*() methods may raise
    • OSError on file read/write errors
    • python-tuf DownloadError when we fail to download something from remote (metadata or target file)
    • python-tuf RepositoryError when the metadata is not valid -- repository is in a state that means we can't continue
    • parsing errors in TrustUpdater._get() code: metadata was valid TUF metadata but does not contain what we expected

Some of these we might not want to handle (like OSError) but e.g. DownloadError could be a fairly common occurrence with network hiccups and such?

@jku jku added the bug Something isn't working label Dec 22, 2022
@woodruffw
Copy link
Member

Some of these we might not want to handle (like OSError) but e.g. DownloadError could be a fairly common occurrence with network hiccups and such?

Yeah, I think we want to prioritize the ones that can come from network problems.

@woodruffw woodruffw added component:tuf TUF related components enhancement New feature or request and removed bug Something isn't working labels Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:tuf TUF related components enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants