From 56e9ded0b8c1a1b16bf916b9529cdb49e0681f44 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 21 Apr 2014 15:14:14 -0700 Subject: [PATCH] Add onError to searchSource in discover. Closes #55 --- src/kibana/apps/discover/controllers/discover.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kibana/apps/discover/controllers/discover.js b/src/kibana/apps/discover/controllers/discover.js index de4a364356f20..c06251f1566d1 100644 --- a/src/kibana/apps/discover/controllers/discover.js +++ b/src/kibana/apps/discover/controllers/discover.js @@ -125,6 +125,13 @@ define(function (require) { if (!angular.equals(sort, currentSort)) $scope.fetch(); }); + searchSource.onError().then(function searchError(err) { + console.log(err); + notify.error('An error occured with your request. Reset your inputs and try again.'); + + return searchSource.onError().then(searchError); + }); + // Bind a result handler. Any time searchSource.fetch() is executed this gets called // with the results searchSource.onResults().then(function onResults(resp) {