Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does amplify.store return error or catch exception when local storage limit exceeded?

Is there e way to check if local storage limit is exceeded after a call like this:

amplify.store("key", object);

What happens if i try to store something bigger than the local storage limit ?

like image 973
Cristi Pufu Avatar asked Sep 20 '12 07:09

Cristi Pufu


1 Answers

yes , it throws "amplify.store quota exceeded" , as you can see here

store.error = function() {
    return "amplify.store quota exceeded"; 
};

...

try {
                    storage.setItem( key, parsed );
                // quota exceeded
                } catch( error ) {
                    // expire old data and try again
                    store[ storageType ]();
                    try {
                        storage.setItem( key, parsed );
                    } catch( error ) {
                        throw store.error();
                    }
                }
like image 149
mariusc Avatar answered Oct 16 '22 05:10

mariusc