Is your feature request related to a problem? Please describe.
I'm encountering an issue where the Error(StatusError) in ResBody is being ignored when using compression middleware. Specifically, when the compression middleware is configured with Service::new(router).hoop(Compression::new().enable_gzip(CompressionLevel::Default)), it fails to handle errors as expected, which is quite frustrating. This makes it difficult to manage and log errors effectively, as they are not being propagated or handled after compression is applied.
Describe the solution you'd like
I would like the middleware to be enhanced so that it properly handles and propagates errors even when compression is applied. This means ensuring that Error(StatusError) in ResBody is recognized and processed correctly by the compression middleware. Ideally, the middleware should check for errors in the response body before applying compression and handle them appropriately to ensure that error handling is not bypassed.
Describe alternatives you've considered
Changing the order of middleware
Is your feature request related to a problem? Please describe. I'm encountering an issue where the Error(StatusError) in ResBody is being ignored when using compression middleware. Specifically, when the compression middleware is configured with Service::new(router).hoop(Compression::new().enable_gzip(CompressionLevel::Default)), it fails to handle errors as expected, which is quite frustrating. This makes it difficult to manage and log errors effectively, as they are not being propagated or handled after compression is applied.
Describe the solution you'd like I would like the middleware to be enhanced so that it properly handles and propagates errors even when compression is applied. This means ensuring that Error(StatusError) in ResBody is recognized and processed correctly by the compression middleware. Ideally, the middleware should check for errors in the response body before applying compression and handle them appropriately to ensure that error handling is not bypassed.
Describe alternatives you've considered Changing the order of middleware