Skip to content

[5.6] [fix/UiSettings] ignore certain errors (#13079)#13409

Merged
spalger merged 5 commits intoelastic:5.6from
spalger:backport/5.6/13079
Aug 22, 2017
Merged

[5.6] [fix/UiSettings] ignore certain errors (#13079)#13409
spalger merged 5 commits intoelastic:5.6from
spalger:backport/5.6/13079

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Aug 9, 2017

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 with SavedObjectClient specific details. This means that the error objects no longer have data.type attached to them. Thankfully, it also means that they have the entire elasticsearch response available so we can just check body.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

@spalger spalger added backport This PR is a backport of another PR blocked v5.6.0 labels Aug 9, 2017
@spalger spalger force-pushed the backport/5.6/13079 branch from e613924 to 1a999c4 Compare August 9, 2017 07:58
@spalger
Copy link
Contributor Author

spalger commented Aug 17, 2017

jenkins, test this

@spalger
Copy link
Contributor Author

spalger commented Aug 18, 2017

@tylersmalley @jbudz I talked with one of you while working on it, but this needed to update _withKibanaIndexAndMappingFallback to check for body.error.type rather than data.type since SavedObjectClient is now decorating es errors rather than replacing them

Mind taking a look?

@spalger spalger requested review from jbudz and tylersmalley August 18, 2017 20:39
@spalger spalger removed the blocked label Aug 18, 2017
Copy link
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - also tested with x-pack

@spalger spalger merged commit 2655237 into elastic:5.6 Aug 22, 2017
@spalger spalger deleted the backport/5.6/13079 branch August 22, 2017 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR v5.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments