[#154, backend/elasticsearch][s]: backend errors now reported up the stack (implement deferred reject when call to backend fails).
This commit is contained in:
@@ -213,6 +213,12 @@ this.recline.Backend.ElasticSearch = this.recline.Backend.ElasticSearch || {};
|
|||||||
results.hits.facets = results.facets;
|
results.hits.facets = results.facets;
|
||||||
}
|
}
|
||||||
dfd.resolve(results.hits);
|
dfd.resolve(results.hits);
|
||||||
|
}).fail(function(errorObj) {
|
||||||
|
var out = {
|
||||||
|
title: 'Failed: ' + errorObj.status + ' code',
|
||||||
|
message: errorObj.responseText
|
||||||
|
};
|
||||||
|
dfd.reject(out);
|
||||||
});
|
});
|
||||||
return dfd.promise();
|
return dfd.promise();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ test("query", function() {
|
|||||||
return {
|
return {
|
||||||
done: function(callback) {
|
done: function(callback) {
|
||||||
callback(sample_data);
|
callback(sample_data);
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
fail: function() {
|
fail: function() {
|
||||||
}
|
}
|
||||||
@@ -224,10 +225,11 @@ test("query", function() {
|
|||||||
return {
|
return {
|
||||||
done: function(callback) {
|
done: function(callback) {
|
||||||
callback(sample_data);
|
callback(sample_data);
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
fail: function() {
|
fail: function() {
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user