这是indexloc提供的服务,不要输入任何密码
Skip to content

minor: use ErrUnknownContentType in more places #799

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

Conversation

costela
Copy link
Contributor

@costela costela commented Apr 13, 2025

This small PR just extends the usage of ErrUnknownContentType to a couple more places where the error was not being wrapped and the error string was being duplicated.

AFAICT that shouldn't have any negative side-effects, except for making error testing a bit more consistent?

@Copilot Copilot AI review requested due to automatic review settings April 13, 2025 08:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

api.go:303

  • Consider adding tests to verify that errors returned with ErrUnknownContentType correctly unwrap to the intended error.
return ct, fmt.Errorf("%w: %s", ErrUnknownContentType, ct)

api.go:326

  • Consider adding tests to verify that errors returned with ErrUnknownContentType correctly unwrap to the intended error.
return fmt.Errorf("%w: %s", ErrUnknownContentType, ct)

Copy link

codecov bot commented Apr 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.10%. Comparing base (58aba1e) to head (0db5bf9).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #799   +/-   ##
=======================================
  Coverage   93.10%   93.10%           
=======================================
  Files          23       23           
  Lines        5296     5296           
=======================================
  Hits         4931     4931           
  Misses        313      313           
  Partials       52       52           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@costela costela changed the title minor: use ErrUnknownContenType in more places minor: use ErrUnknownContentType in more places Apr 13, 2025
@danielgtaylor danielgtaylor requested a review from Copilot April 15, 2025 23:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Copy link
Owner

@danielgtaylor danielgtaylor left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@danielgtaylor danielgtaylor merged commit 811c592 into danielgtaylor:main Apr 15, 2025
5 checks passed
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