Closed nmDejamobile closed 8 years ago
A cache result will only be returned if it's not expired. Could it be the case that sometimes this is the case? Because then the cache will be skipped and the normal request will be executed. Of course this request would require an internet connection.
When you do see this error, did you also see a call to the function cachedResponseForRequest? What dit it return and at what point? Set EVURLCache.LOGGING = true
to see what is going on.
If a request has failed like this and you are positive that it's in the cache, you can still get the file by reading it from : EVURLCache.storagePathForRequest(theRequest)
Is this still an issue?
When on offline "plane mode", the following error appears and provides a
Result.Failure
enum type forresponse.result
for the Alamofire request.The strange thing is that previous request url offline cache works well on the same domain.
I tried to disable the previous request but the failing one still fails.
Any tips to debug ? I added breakpoints in Alamofire where errors are thrown, and also in EVURLCache.swift but I couldn't find where what throws this error. It looks to be lower level than EVURLCache or Alamofire
Note that all caches work well when in online mode.
the full error is :
FAILURE: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
My request code is the following :
and EVURLCache is loaded with :