{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/3371","labels_url":"https://api.github.com/repos/elastic/kibana/issues/3371/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/3371/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/3371/events","html_url":"https://github.com/elastic/kibana/issues/3371","id":62287044,"number":3371,"title":"`notify.error` expects an instance of `Error` and not a string in `discover.js`","user":{"login":"kadishmal","id":978004,"avatar_url":"https://avatars.githubusercontent.com/u/978004?v=3","gravatar_id":"","url":"https://api.github.com/users/kadishmal","html_url":"https://github.com/kadishmal","followers_url":"https://api.github.com/users/kadishmal/followers","following_url":"https://api.github.com/users/kadishmal/following{/other_user}","gists_url":"https://api.github.com/users/kadishmal/gists{/gist_id}","starred_url":"https://api.github.com/users/kadishmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadishmal/subscriptions","organizations_url":"https://api.github.com/users/kadishmal/orgs","repos_url":"https://api.github.com/users/kadishmal/repos","events_url":"https://api.github.com/users/kadishmal/events{/privacy}","received_events_url":"https://api.github.com/users/kadishmal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-17T04:58:25Z","updated_at":"2015-03-17T04:58:25Z","closed_at":null,"body":"[discover.js](https://github.com/elastic/kibana/blob/master/src/kibana/plugins/discover/controllers/discover.js#L246) has the following code:\r\n\r\n        $scope.searchSource.onError(function (err) {\r\n          console.log(err);\r\n          notify.error('An error occured with your request. Reset your inputs and try again.');\r\n        }).catch(notify.fatal);\r\n\r\nBut `notify.error` [needs](https://github.com/elastic/kibana/blob/master/src/kibana/components/notify/_notifier.js#L220) an instance of `Error` for `err.stack.indexOf`.\r\n\r\n    Notifier.prototype.error = function (err, cb) {\r\n      add({\r\n        type: 'danger',\r\n        content: formatMsg(err, this.from),\r\n        icon: 'warning',\r\n        title: 'Error',\r\n        lifetime: Infinity,\r\n        actions: ['report', 'accept'],\r\n        stack: err.stack.indexOf(err.message) > -1 ? err.stack : (err.message + err.stack)\r\n      }, cb);\r\n    };\r\n\r\nCan send a PR if it will be accepted."}}