Catch exception if unable to cache the response

This commit is contained in:
Alexandre Beloin 2015-02-09 14:07:40 -05:00
parent b283015d38
commit c5cfede638
1 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,11 @@ class CacheControlAdapter(HTTPAdapter):
response = cached_response
else:
# try to cache the response
self.controller.cache_response(request, response)
try:
self.controller.cache_response(request, response)
except Exception as e:
# Failed to cache the results
pass
resp = super(CacheControlAdapter, self).build_response(
request, response