Is response_filter behaving as expected/intended? #231
Replies: 3 comments
-
No, in this case it can't prevent 500 responses - you'd have to check in your app if your caching backend works or not. |
Beta Was this translation helpful? Give feedback.
-
I see, in this case is it possible to extend I agree with you that is on the application developer the responsability to check if the Redis server is available or not, but I think it's flask-caching responsability to not throw such kind of exception, handling it and maybe throwing a specific error or even a warning log. It will be more handy to use |
Beta Was this translation helpful? Give feedback.
-
If you have got an idea on how to solve that, feel free to open a new PR :) |
Beta Was this translation helpful? Give feedback.
-
I'm trying to figure out how
response_filter
behaves, it looks like it doens't prevent 500 responses. For instance let's suppose we setup redis backend and the application weren't able to connection because something bad happened to connect to redis instance, so it throws anredis.exceptions.ConnectionError
, in the way the decoratormemoize
was written theresponse_filter
calllable will end up not having the chance to handle this connection error and the application will throw the 500 error to the client.I'm right here folks?
Beta Was this translation helpful? Give feedback.
All reactions