Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not wrap SO errors in Boom #72441

Open
mshustov opened this issue Jul 20, 2020 · 1 comment
Open

Do not wrap SO errors in Boom #72441

mshustov opened this issue Jul 20, 2020 · 1 comment
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@mshustov
Copy link
Contributor

mshustov commented Jul 20, 2020

SavedObjects client wraps ES errors in Boom. https://github.com/elastic/kibana/blob/master/src/core/server/saved_objects/service/lib/decorate_es_error.ts
We already have SavedObjectsErrorHelpers that encapsulates that knowledge. In theory, it should simplify the cleanup, although, we need to inspect solution code to make sure Boom-specific API is not used.

// before
try {
  await client.do.something();
} catch (error) {
  if (error.status === 409) { /* handle */ }
}
// after
try {
  await client.do.something();
} catch (error) {
  if (savedObjectsClient.errors.isConflictError(error)) { /* handle */ }
}
@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc enhancement New value added to drive a business result labels Jul 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@mshustov mshustov changed the title Do no wrap SO errors in Boom Do not wrap SO errors in Boom Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
Development

No branches or pull requests

2 participants