Closed bhavyarm closed 6 years ago
I don't think there is much we can do about this. We can't grab the title to give a more informative error message, because the title doesn't exist anymore - all we have is the id.
We could detect a missing saved object, swallow the error, and redirect the user to the app's landing page, but I don't know if that would be better because then we are hiding information.
It would be nice if we could figure out a way to prevent displaying an error in this specific scenario. The user did nothing wrong, we shouldn't be throwing an error in their face. But I don't think we should swallow all errors of this type. If someone visited an old bookmark for a saved search that was deleted a long time ago, this would be the correct behavior.
Perhaps a good compromise would be to display an info notification saying "Could not locate that search (id:). Showing default search instead." so it's more like a redirect than an error.
Removing discuss label, decided @Bargs suggestion of a blue info message instead of red warning label is a good resolution.
Initially I thought this would be as simple as changing a notify.error
to notify.info
call, but in actuality, a KbnError of type SavedObjectNotFound is being thrown. I don't think we currently have a way to catch known errors and map them to something other than type error
.
Kibana version: master
Elasticsearch version: master
Server OS version: darwin
Browser version: chrome latest
Browser OS version: OS X
Original install method (e.g. download page, yum, from source, etc.): QA builds for tribe nodes
Description of the problem including expected versus actual behavior: The toaster message when a user navigates back to Discover after deleting a saved search under saved objects in Management is confusing. The toaster message in Discover gets displayed with unique search id(eg: 9684a9e0-cd3b-11e6-950e-3b217fa2ddeb)of that saved search.Also, I am not sure if Kibana should be displaying this message.
Please note in 5.1.1 this gets displayed with the saved search name instead of the id.
Steps to reproduce:
Errors in browser console (if relevant):
commons.bundle.js?v=14833:38 Error: Could not locate that search (id: 9684a9e0-cd3b-11e6-950e-3b217fa2ddeb) at SavedObject.applyESResp (kibana.bundle.js?v=14833:29) at processQueue (commons.bundle.js?v=14833:38) at commons.bundle.js?v=14833:38 at Scope.$eval (commons.bundle.js?v=14833:39) at Scope.$digest (commons.bundle.js?v=14833:39) at Scope.$apply (commons.bundle.js?v=14833:39) at done (commons.bundle.js?v=14833:37) at completeRequest (commons.bundle.js?v=14833:37) at XMLHttpRequest.xhr.onload (commons.bundle.js?v=14833:37)
Provide logs and/or server output (if relevant): None