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

Remove nil error from being printed in "persist metadata" error message #633

Merged

Conversation

malancas
Copy link
Contributor

@malancas malancas commented Apr 17, 2024

When go-tuf is unable to persist the TUF metadata, I receive the error "failed to persist metadata: %!w(<nil>)". Because the code already checks if the error is not nil and returns it if not on line 651, the "failed to persist" error message will always try to print a nil error.

@malancas malancas marked this pull request as ready for review April 18, 2024 15:18
Copy link
Contributor

@MDr164 MDr164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently preparing a really big PR that takes care of error checking in general to avoid things like this from happening but good thing you spotted this one here early.

@MDr164 MDr164 merged commit 1d60fd9 into theupdateframework:master May 3, 2024
23 checks passed
@malancas malancas deleted the fix-metadata-persist-err-msg branch May 3, 2024 14:34
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.94%. Comparing base (14cf073) to head (e2b2ca7).
Report is 20 commits behind head on master.

Files Patch % Lines
metadata/updater/updater.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #633      +/-   ##
==========================================
+ Coverage   70.51%   72.94%   +2.43%     
==========================================
  Files          10       10              
  Lines        2123     1656     -467     
==========================================
- Hits         1497     1208     -289     
+ Misses        505      327     -178     
  Partials      121      121              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants