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

throw config error based on the joi validation error #29137

Merged
merged 1 commit into from
Jan 23, 2019

Conversation

kobelb
Copy link
Contributor

@kobelb kobelb commented Jan 22, 2019

No description provided.

@kobelb kobelb requested review from azasypkin and legrego January 22, 2019 21:37
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI - Tested locally. If there isn't a rush, let's wait on merging until @azasypkin also has a chance to review.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -124,7 +124,10 @@ export class Config {
});

if (results.error) {
throw results.error;
const error = new Error(results.error.message);
Copy link
Member

Choose a reason for hiding this comment

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

note: I prefer your solution to something like delete results.error._object; or dealing with any.error(...) since:

  • we don't rely on Joi internals
  • we throw error that we control (and ideally we should do that everywhere)

@kobelb kobelb merged commit e7c28fd into elastic:master Jan 23, 2019
@kobelb kobelb deleted the config-errors branch January 23, 2019 13:55
@kobelb kobelb added the v7.0.0 label Jan 23, 2019
kobelb added a commit to kobelb/kibana that referenced this pull request Jan 23, 2019
kobelb added a commit to kobelb/kibana that referenced this pull request Jan 23, 2019
@kobelb kobelb removed the v6.6.0 label Jan 23, 2019
@kobelb kobelb added v6.7.0 non-issue Indicates to automation that a pull request should not appear in the release notes labels Jan 23, 2019
@kobelb kobelb added v6.6.0 and removed v6.6.1 labels Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-issue Indicates to automation that a pull request should not appear in the release notes v6.6.0 v6.7.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants