Skip to content

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