Cache
Cache copied to clipboard
Fixed AsyncStorage `exists` not throwing errors
Current existsObject() returns true or throw error, not returning false.
As per StorageAware, existsObject() should not throw an error.
Fix existsObject() to return false instead of error.
Hi @kitwtnb,
Would you be so kind on adding a tests that reproduces the error as well to avoid regressions?
Changed Result<Bool, Error> to Bool and removed throws.
So we could express by type that the previous problem does not regression.
Do I need to test separately from these?
Can anyone else verify if this breaks anything for them?
I understand what you are trying to say.
This test originally reproduced the problem.
I expect it to throw an Error instead of false if the object does not exist.
https://github.com/hyperoslo/Cache/pull/325/files#diff-360238a58739325a7ce97d0a648b466797db4442b6cae0592f1bb2e26c0f97d7L90