Skip to content

ref(types): Hide jsonwebtoken and mediatype error types - #745

Merged
jan-auer merged 2 commits into
mainfrom
ref/hide-dep-errors
Oct 30, 2026
Merged

jan-auer merged 2 commits into
mainfrom
ref/hide-dep-errors

Conversation

@jan-auer

Copy link
Copy Markdown
Member

The published crates expose error types from two dependencies. Because of this, a major upgrade of these dependencies is a breaking change for our users. #744 keeps them on their current versions for this reason.

This PR makes the breaking change once, so that later upgrades are not breaking:

  • objectstore_client::Error::TokenError now contains objectstore_client::TokenError instead of jsonwebtoken::errors::Error.
  • objectstore_types::metadata::Error::ContentType now contains objectstore_types::metadata::InvalidContentType instead of mediatype::MediaTypeError.

The new types are opaque. They show the message of the underlying error, so errors are as descriptive as before. The public API no longer has From conversions from the dependency error types.

The token error message now also gives context, for example failed to create auth token: InvalidKeyFormat instead of only InvalidKeyFormat.

Changelog Entry

Error::TokenError and metadata::Error::ContentType now wrap opaque error types instead of the jsonwebtoken and mediatype error types.

  • Code that matches on the variant with _ needs no change. Code that inspects the inner error can use its message instead.

@jan-auer
jan-auer requested a review from a team as a code owner October 30, 2026 10:31
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

This PR lands in these workspaces:

  • clients/rust: 🟢 Patch (bug fixes)
📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Other Changes

  • Error::TokenError and metadata::Error::ContentType now wrap opaque error types instead of the jsonwebtoken and mediatype error types. by jan-auer in #745
  • Code that matches on the variant with _ needs no change. Code that inspects the inner error can use its message instead. by jan-auer in #745

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.55%. Comparing base (546e375) to head (b7a990e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #745   +/-   ##
=======================================
  Coverage   91.54%   91.55%           
=======================================
  Files         116      116           
  Lines       22088    22090    +2     
=======================================
+ Hits        20221    20224    +3     
+ Misses       1867     1866    -1     
Components Coverage Δ
Rust Backend 94.74% <100.00%> (ø)
Rust Client 84.31% <100.00%> (+0.01%) ⬆️
Python Client 93.88% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 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.

@jan-auer
jan-auer force-pushed the ref/hide-dep-errors branch from 99be7fe to b7a990e Compare October 30, 2026 10:37
@jan-auer jan-auer changed the title ref(types)!: Hide jsonwebtoken and mediatype error types ref(types)\: Hide jsonwebtoken and mediatype error types Oct 30, 2026
@jan-auer jan-auer changed the title ref(types)\: Hide jsonwebtoken and mediatype error types ref(types): Hide jsonwebtoken and mediatype error types Oct 30, 2026
@jan-auer

Copy link
Copy Markdown
Member Author

Marking this as not breaking this one time.

@jan-auer
jan-auer merged commit 7066f00 into main Oct 30, 2026
28 checks passed
@jan-auer
jan-auer deleted the ref/hide-dep-errors branch October 30, 2026 10:53
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