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

rafs: cleanup errors #1654

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

liubogithub
Copy link
Collaborator

Based on the error definition, InvalidData is preferable than InvalidInput.

Data not valid for the operation were encountered. Unlike [InvalidInput], this typically means that the operation parameters were valid, however the error was caused by malformed input data. For example, a function that reads a file into a string will error with InvalidData if the file's contents are not valid UTF-8.

Relevant Issue (if applicable)

If there are Issues related to this PullRequest, please list it.

Details

Please describe the details of PullRequest.

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@liubogithub liubogithub requested a review from a team as a code owner December 13, 2024 07:02
@liubogithub liubogithub requested review from imeoer, jiangliu and gaius-qi and removed request for a team December 13, 2024 07:02
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 60.04%. Comparing base (365f13e) to head (89c9f28).

Files with missing lines Patch % Lines
rafs/src/fs.rs 0.00% 5 Missing ⚠️
rafs/src/metadata/direct_v6.rs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1654      +/-   ##
==========================================
- Coverage   60.05%   60.04%   -0.01%     
==========================================
  Files         147      147              
  Lines       49624    49624              
  Branches    47078    47078              
==========================================
- Hits        29800    29799       -1     
- Misses      18041    18042       +1     
  Partials     1783     1783              
Files with missing lines Coverage Δ
api/src/config.rs 86.33% <100.00%> (ø)
api/src/error.rs 67.74% <ø> (ø)
rafs/src/metadata/direct_v6.rs 44.01% <0.00%> (ø)
rafs/src/fs.rs 34.19% <0.00%> (ø)

... and 3 files with indirect coverage changes

@liubogithub liubogithub changed the title rafs: unify error code rafs: cleanup errors Dec 13, 2024
Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

LGTM!

@imeoer
Copy link
Collaborator

imeoer commented Dec 16, 2024

Not really sure, it seems the changes break some CI tests due to IO errors: https://github.com/dragonflyoss/nydus/actions/runs/12311443544/job/34446727113?pr=1654

@liubogithub
Copy link
Collaborator Author

liubogithub commented Dec 22, 2024

Thanks, let me figure it out.
The error seems irrelevant, let me rebase and test it again.

Based on the error definition, InvalidData is preferable than InvalidInput.

Data not valid for the operation were encountered.
Unlike [InvalidInput], this typically means that the operation parameters were valid, however the error was caused by malformed input data.
For example, a function that reads a file into a string will error with InvalidData if the file's contents are not valid UTF-8.

Signed-off-by: Liu Bo <[email protected]>
With error macros, debug mode can show more informations such as stack trace.

Signed-off-by: Liu Bo <[email protected]>
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.

2 participants