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

Change compression body error type to BoxError #166

Merged
merged 7 commits into from
Nov 15, 2021

Conversation

davidpdrsn
Copy link
Member

The compression related middleware would previously use BodyOrIoError
as the body error type. That only implemented std::error::Error if the
inner error did as well. Since Box<dyn std::error::Error + Send + Sync>
does not implement std::error::Error Compression and
Decompression wouldn't be usable with hyper if the body they wrapped
had that error type.

This changes the middleware to use BoxError as the error type which
resolves the issue. Its also consistent with other middleware.

Reimplementation of #107 on top of latest master.

The compression related middleware would previously use `BodyOrIoError`
as the body error type. That only implemented `std::error::Error` if the
inner error did as well. Since `Box<dyn std::error::Error + Send + Sync>`
does not implement `std::error::Error` `Compression` and
`Decompression` wouldn't be usable with hyper if the body they wrapped
had that error type.

This changes the middleware to use `BoxError` as the error type which
resolves the issue. Its also consistent with other middleware.

Reimplementation of #107 on top of latest `master`.
@davidpdrsn davidpdrsn enabled auto-merge (squash) November 15, 2021 12:30
@davidpdrsn davidpdrsn merged commit 8d446f4 into master Nov 15, 2021
@davidpdrsn davidpdrsn deleted the change-compression-error-type-2 branch November 15, 2021 13:16
@davidpdrsn davidpdrsn mentioned this pull request Dec 1, 2021
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