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

refactor!: modernize exceptions #98

Merged
merged 8 commits into from
Jan 11, 2024

Conversation

shizhMSFT
Copy link
Contributor

What this PR does / why we need it

  • Modernize all exception classes with latest dotnet / C# features.
  • Move related exceptions class to match the same package structure as oras-go.
  • Remove unused exceptionss
  • Introduce ResponseException to parse server error responses

Which issue(s) this PR resolves / fixes

Resolve partially #91

Please check the following list

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (cca9526) 70.93% compared to head (c35e717) 80.15%.

Files Patch % Lines
...s/Registry/Remote/HttpResponseMessageExtensions.cs 42.85% 6 Missing and 2 partials ⚠️
...sProject.Oras/Registry/Remote/ResponseException.cs 74.07% 3 Missing and 4 partials ⚠️
.../OrasProject.Oras/Registry/Remote/ManifestStore.cs 42.85% 2 Missing and 2 partials ⚠️
src/OrasProject.Oras/Registry/Remote/BlobStore.cs 25.00% 1 Missing and 2 partials ⚠️
src/OrasProject.Oras/Content/MemoryStorage.cs 60.00% 1 Missing and 1 partial ⚠️
src/OrasProject.Oras/Registry/Remote/UriFactory.cs 0.00% 2 Missing ⚠️
src/OrasProject.Oras/Content/Extensions.cs 66.66% 1 Missing ⚠️
src/OrasProject.Oras/Registry/Remote/Repository.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   70.93%   80.15%   +9.22%     
==========================================
  Files          33       30       -3     
  Lines         922      897      -25     
  Branches      105      108       +3     
==========================================
+ Hits          654      719      +65     
+ Misses        215      124      -91     
- Partials       53       54       +1     

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

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit 894ea72 into oras-project:main Jan 11, 2024
7 checks passed
@shizhMSFT shizhMSFT mentioned this pull request Jan 15, 2024
3 tasks
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