CacheOutput Eating Exception Handler
CacheOutput version 2.0.2 Eating Exception Handler.
without CacheOutput, the code beyond:
response is:

enable CacheOutput, the code beyond:
response is none!

Hey,
What is the status code of the response when the exception occurred? Is this cacheable? Can you provide more details on the exception handler implemented and registered in Startup.cs?
Status Code when the exception occurred is 0,in Startup.cs file,registered component as document says:
And our platform has a middleware to handler custom exception,the code as followed:
if not enable cacheoutput, can return correct,
but enable cacheoutput, return empty,

So you are expecting to see exactly the same cached result (HTTP 200 is cacheable by default)?
Can you create a minimal viable example of the application with your middleware so I will be able to reproduce it?
Hey @Iamcerba I bumped into the same issue. Created an example here https://github.com/abzubarev/Test.CacheOutputEatingExceptions
@abzubarev I will take a look later. Seems like something was broken after https://github.com/Iamcerba/AspNetCore.CacheOutput/pull/15
Thanks!
@abzubarev I've created a release 2.0.3 that should fix the issue.
@mgoodfellow I've reverted your https://github.com/Iamcerba/AspNetCore.CacheOutput/pull/15 as well until another working solution will be found.
@Iamcerba already fixed - seems I only had a min to look when you reverted the change out. It isn't a complex issue - just need to check the result of next() and if it fails, we swap the memory stream back over
Thanks a lot, didn't have much time to work on it so reverted... Will take a look at a fix. Appreciate.
No worries - I personally wasn't affected as we use the middleware pipeline to check for exceptions rather than layers of filters. I think that is the more common approach nowadays - maybe why it hasn't been reported sooner? Apologies though, it seems I overlooked one result edge case when looking for points to swap back the MemoryStream.
Would be good to revert the revert, and then merge in https://github.com/Iamcerba/AspNetCore.CacheOutput/pull/22 if possible! Thanks
Agree that middleware for exceptions handling is a more common practice. Hopefully, I will find additional time to start working on integration and unit tests.
2.0.3.1 which resolves this issue has been released.