paulirish/jquery-ajax-localstorage-cache — pull request #10 by bshelton229 (2012-10-17 00:12:40+00:00)
Title: Catch exceptions when saving to localStorage, which should catch over quota errors.

Added some exception handling around localStorage.setItem(), and optionally pass the exception to a cacheError() callback if defined. My use case is to catch any QUOTA_EXCEEDED_ERR exceptions, and to use the callback to selectively clean up some cached items in that event. I couldn't find a better way to check for over limit errors, I'm not sure if this is the best approach or not.