error

Fired when there's an error retrieving, saving or validation data.

The event object can have the following properties:

errorType - the type of the error - e.g: transport or validation
error - the error message in case of a validation error, or the jQuery XHR object in case of a transport error
operation - in case of a transport error, this property will be set with either read or save
path - set in case of a validation error, this property will contain the schema path for the value being validated
value - set in case of a validation error, this property will contain the value being validated

var dataSource = new shield.DataSource({
    events: {
        error: function (e) {
            if (e.type == "transport") {
                // transport error is an ajax error; reason holds the xhr object
                alert("transport error: " + e.reason.statusText);

                // reload the data source if the operation that failed was save
                if (e.operation == "save") {
                    this.read();
                }
            }
            else {
                // other data source error - validation, etc
                alert(e.type + " error: " + e.reason);
            }
        }
    }
});