angular-local-storage
angular-local-storage copied to clipboard
Should throw exception if trying to exceed the quota.
The problem is in addToLocalStorage, if you save something that exceeds the quota it will broadcast the error and try to save it in cookies, if that fails, it will broadcast another error.
I would recommend having a general store method and in the service configuration check if it can store to local storage or not, and using that point store to addToLocalStorage or addToCookies
Each of those methods should either throw an exception or return a failed promise