Wrapped localstorage.setItem in try block to avoid uncaught exceptions.

Example: QuotaExceededError (iOS simulators)