[5.6] [fix/UiSettings] ignore certain errors (#13079) #13409
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
5.6 specific changes:
9facf4d: Since
SavedObjectClient
in 5.6 has_withKibanaIndexAndMappingFallback
, which checks for specific error types and uses a fallback request when they are found. This PR changes the error handling to stop overwriting the es errors and instead decorate them withSavedObjectClient
specific details. This means that the error objects no longer havedata.type
attached to them. Thankfully, it also means that they have the entire elasticsearch response available so we can just checkbody.error.type
instead.[SavedObjectClient] emit detectable errors
[uiSettingsService] consume new SavedObjectsClient errors
[SavedObjectsClient] expose errorTypeHelpers as such
[elasticsearch/tests] recreate error for each test
[http] wait for elasticsearch plugin to be ready
[shortUrl/tests] ensure that create request responds with 200
[shortUrl] use errorTypeHelpers to filter errors
[uiSettings/savedObjectsClientStub] stub errorTypeHelpers
[SavedObjectsClient/errors] expose error module so tests can make errors
[shortUrl/tests] use actual SavedObjectsClient errors
[uiSettings/savedObjectsClientStub] use actual errors lib
[SavedObjectsClient] use decorate instead of "wrap"
[server/routes/uiSettings] refactor routes to forward Boom errors from uiSettings
[uiSettings] colocate routes and service
[testUtils/esTestCluster] use more standard api style
[testUtils/es] add createCallCluster util
[testUtils/esTestCluster] add getters for client/callCluster
[es/healthcheck] ensure that healtcheck stops when server is stopped
[uiSettings/routes] add param/payload validation
[uiSettings/routes] add tests that verify error behaviors