mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Courier] added errors for VersionConflicts and DocFetchFailures
This commit is contained in:
parent
77db7177b1
commit
99b510b174
1 changed files with 27 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
define(function (require, module, exports) {
|
||||
define(function (require) {
|
||||
var listenerCount = require('utils/event_emitter').listenerCount;
|
||||
var errors = {};
|
||||
|
||||
// caused by a refresh attempting to start before the prevous is done
|
||||
function HastyRefresh() {
|
||||
|
@ -8,5 +9,29 @@ define(function (require, module, exports) {
|
|||
}
|
||||
HastyRefresh.prototype = new Error();
|
||||
HastyRefresh.prototype.constructor = HastyRefresh;
|
||||
exports.HastyRefresh = HastyRefresh;
|
||||
errors.HastyRefresh = HastyRefresh;
|
||||
|
||||
|
||||
// where there is an error getting a doc
|
||||
function DocFetchFailure(resp) {
|
||||
this.name = 'DocFetchFailure';
|
||||
this.resp = resp;
|
||||
this.message = 'Failed to get the doc: ' + JSON.stringify(resp);
|
||||
}
|
||||
DocFetchFailure.prototype = new Error();
|
||||
DocFetchFailure.prototype.constructor = DocFetchFailure;
|
||||
errors.DocFetchFailure = DocFetchFailure;
|
||||
|
||||
|
||||
// there was a conflict storing a doc
|
||||
function VersionConflict(resp) {
|
||||
this.name = 'VersionConflict';
|
||||
this.resp = resp;
|
||||
this.message = 'Failed to store document changes do to a version conflict.';
|
||||
}
|
||||
VersionConflict.prototype = new Error();
|
||||
VersionConflict.prototype.constructor = VersionConflict;
|
||||
errors.VersionConflict = VersionConflict;
|
||||
|
||||
return errors;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue