-
Notifications
You must be signed in to change notification settings - Fork 27.5k
$cacheFactory.remove() throws exception when the key does not exists #1497
Comments
Reproduce scenario: http://jsfiddle.net/MC3wm/ (error in the console). It is probably a good idea to ignore removal of non-existing values (that is, don't throw exceptions in this case). Or at least provide a more descriptive error message. |
@pkozlowski-opensource I saw your comment come through my email but it seems to have disappeared. After you mentioned it, I did a few tests with putting in 0 or false in the cache but it seemed to work alright. I can change it over to use isUndefined() instead if you think that would be a safer route. |
@jtymes Ignore my comment, I've misread your code. The fix looks good. Travis-CI is failing atm but I'm not sure if this is linked to your fix. |
Looks good, cause there the only results of |
Instead of throwning an exception, remove should return undefined when cache entry to be removed doesn't exist. Closes #1497
Instead of throwning an exception, remove should return undefined when cache entry to be removed doesn't exist. Closes angular#1497
Instead it should simply return.
Angular Version 1.0.2
The text was updated successfully, but these errors were encountered: