storage.mechanism.ErrorHandlingMechanism Extends goog.storage.mechanism.Mechanism
Wraps a storage mechanism with a custom error handler.

Inheritance

Constructor

goog.storage.mechanism.ErrorHandlingMechanism(mechanismerrorHandler)

Parameters

mechanism : !goog.storage.mechanism.Mechanism
Underlying storage mechanism.
errorHandler : goog.storage.mechanism.ErrorHandlingMechanism.ErrorHandler
An error handler.

Instance Methods

Public Protected Private
errorHandler_()
The error handler.
code »
get()
No description.
code »
remove()
No description.
code »
set()
No description.
code »
get(key) ?string
Get the value stored under a key.
Arguments:
key : string
The key to get.
Returns: ?string  The corresponding value, null if not found.
code »
remove(key)
Remove a key and its value.
Arguments:
key : string
The key to remove.
code »
set(keyvalue)
Set a value for a key.
Arguments:
key : string
The key to set.
value : string
The string to save.
code »

Instance Properties

constructor :
No description.
Code »
The mechanism to be wrapped.
Code »

Static Properties

goog.storage.mechanism.ErrorHandlingMechanism.ErrorHandler :
A function that handles errors raised in goog.storage. Since some places in the goog.storage codebase throw strings instead of Error objects, we accept these as a valid parameter type. It supports the following arguments: 1) The raised error (either in Error or string form); 2) The operation name which triggered the error, as defined per the ErrorHandlingMechanism.Operation enum; 3) The key that is passed to a storage method; 4) An optional value that is passed to a storage method (only used in set operations).
Code »
goog.storage.mechanism.ErrorHandlingMechanism.superClass_ :
No description.
Code »

Enumerations

goog.storage.mechanism.ErrorHandlingMechanism.Operation :
Valid storage mechanism operations.
Constants:
GET
No description.
REMOVE
No description.
SET
No description.
Code »

Package storage.mechanism

Package Reference