Re: Detailed review of 4.11. Client-side persistent storage

On Sat, 9 Feb 2008, Mihai Sucan wrote:
> > > 
> > > I mean, a script should be able to check if the disk quota is full 
> > > or not, such that the author of the document can inform the user.
> > 
> > To some extent this is now possible, since setItem() returns false if 
> > it fails (though how that interacts with the implied setter, I'm not 
> > sure -- implementation feedback would be useful here: is it even 
> > possible to do this sensibly? What should I do here?).
> 
> Here's an idea: add a property to the Storage object, "lastError". The 
> property is updated in case of errors when using the implied 
> getter/setter, also when using the rest of the defined methods. This 
> should be sufficient.

That's pretty inconsistent compared to the rest of the Web APIs.

I've made the spec go back to raising an exception when hitting the quota 
limits, after discussing this with the Mozilla guys.

I'm interested in seeing how people use this. It will help guide how to 
extend this API with ways to detect quota issues.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 12 February 2008 01:19:25 UTC