You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.
Hi, this is a minor thing, but I recently discovered that if you configure RxCache with a directory that does not exist (but can be created - so there are no access rights issues, someone just needs to call mkdirs on it), you are going to get the following exception:
io.rx_cache.RxCacheException: The Loader provided did not return any data and there is not data to load from the Cache getEpisodes
(Plus a very very long stack trace of course)
This I find a little dangerous, because it makes you start debugging the wrong parts of your code. :D Only if you go through the whole stack trace, on the bottom you can see that that it was caused by a file not found error. And even that isn't a very good hint, because if you don't know how the persistent cache works internally, you are going to assume that this just means there indeed isn't any data cached.
So I would propose to either:
Make sure the directory exists and is writeable right during the configuration phase
Or make the error handling a bit more flexible so that not everything looks like it was caused by an empty loader
(And I'll gladly make a pull request, just tell me which one seems better to you)
The text was updated successfully, but these errors were encountered:
daemontus
changed the title
RxCacheException when cache directory does not exist
Misleading exception when cache directory does not exist
Aug 25, 2016
I think the first approach should be done, because the second one is going to be harder to implement. Plus, making the app crash as soon as possible it seems to be a better way to deal with errors ;)
Regarding the usage: Yes, it's Android. It was just a subdirectory of the default cache folder -File(context.getCacheDir(), "some_subdir") - I was playing with different caching libraries at the same time and thought it would be a good idea to separate them from each other, just in case :)
Hi, this is a minor thing, but I recently discovered that if you configure RxCache with a directory that does not exist (but can be created - so there are no access rights issues, someone just needs to call mkdirs on it), you are going to get the following exception:
io.rx_cache.RxCacheException: The Loader provided did not return any data and there is not data to load from the Cache getEpisodes
(Plus a very very long stack trace of course)
This I find a little dangerous, because it makes you start debugging the wrong parts of your code. :D Only if you go through the whole stack trace, on the bottom you can see that that it was caused by a file not found error. And even that isn't a very good hint, because if you don't know how the persistent cache works internally, you are going to assume that this just means there indeed isn't any data cached.
So I would propose to either:
(And I'll gladly make a pull request, just tell me which one seems better to you)
The text was updated successfully, but these errors were encountered: