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

Preserve service error type in RequestDecompression #368

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

rtimush
Copy link
Contributor

@rtimush rtimush commented May 17, 2023

There seems to be no reason for RequestDecompression to change the service error type to BoxError, so it would be nice to preserve the underlying error type. This is especially useful if the inner service is infallible.

Motivation

When I add RequestDecompressionLayer to a stack of infallible layers, the resulting service has BoxError as an error type, but it never actually fails.

Solution

Make RequestDecompression preserve the error type of the inner service.

@jplatte jplatte added C-cleanup Category: PRs that clean code up or issues documenting cleanup. breaking change A PR that makes a breaking change. labels Jul 19, 2023
@jplatte jplatte requested review from davidpdrsn and Nehliin August 3, 2023 10:36
@jplatte jplatte mentioned this pull request Nov 10, 2023
6 tasks
Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

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

Thanks! I'll fix CI and update the changelog.

@davidpdrsn davidpdrsn merged commit d2eadcb into tower-rs:master Nov 20, 2023
6 checks passed
@rtimush rtimush deleted the decompression-keep-error-type branch January 3, 2024 09:58
psFried added a commit to estuary/connectors that referenced this pull request Feb 22, 2024
Axum and tower-http had a few minor breaking changes. Tower-http
[improved error handling of RequestDecompressionLayer](tower-rs/tower-http#368),
which allowed removal of some annoying error conversion code.
psFried added a commit to estuary/connectors that referenced this pull request Feb 22, 2024
Axum and tower-http had a few minor breaking changes. Tower-http
[improved error handling of RequestDecompressionLayer](tower-rs/tower-http#368),
which allowed removal of some annoying error conversion code.
jonwihl pushed a commit to estuary/connectors that referenced this pull request Mar 13, 2024
Axum and tower-http had a few minor breaking changes. Tower-http
[improved error handling of RequestDecompressionLayer](tower-rs/tower-http#368),
which allowed removal of some annoying error conversion code.
jonwihl pushed a commit to estuary/connectors that referenced this pull request Mar 18, 2024
Axum and tower-http had a few minor breaking changes. Tower-http
[improved error handling of RequestDecompressionLayer](tower-rs/tower-http#368),
which allowed removal of some annoying error conversion code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A PR that makes a breaking change. C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants