Sha256: 70a4a1525c1d25b1785f0e5e42c266aab53b908ed4d93fb377a48d6890440b9e
Contents?: true
Size: 1.18 KB
Versions: 19
Compression:
Stored size: 1.18 KB
Contents
/** * pageflow.Failure and subclasses are used in the failures api. * * Subclasses that represent failures that are can not be retried should * override `catRetry` with false. * Retryable failures should implement `retryAction`. */ pageflow.Failure = pageflow.Object.extend({ canRetry: true, type: 'Failure', initialize: function(model) { this.model = model; }, retry: function() { if (this.canRetry) { return this.retryAction(); } }, retryAction: function() { return this.model.save(); }, key: function() { return this.model.cid + '-' + this.type; } }); /** * SavingFailure represents a unsuccessful attempt to save * a model on the server. */ pageflow.SavingFailure = pageflow.Failure.extend({ type: 'SavingFailure' }); /** * OrderingFailure represent a unsuccessful attempt to save * the ordering of a pageflow.orderedCollection. */ pageflow.OrderingFailure = pageflow.Failure.extend({ type: 'OrderingFailure', initialize: function(model, collection) { pageflow.Failure.prototype.initialize.call(this, model); this.collection = collection; }, retryAction: function() { return this.collection.saveOrder(); } });
Version data entries
19 entries across 19 versions & 1 rubygems