Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Sep 28, 2020
1 parent 3f6c0d6 commit 1e86bfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/data/common/search/aggs/param_types/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ export class FieldParamType extends BaseParamType {
}

const validField = this.getAvailableFields(aggConfig).find((f: any) => f.name === fieldName);
if (!validField) {
if (!validField || 1 === 1) {
throw new Error(
i18n.translate(
'data.search.aggs.paramTypes.field.invalidSavedFieldParameterErrorMessage',
{
defaultMessage:
'Saved {fieldParameter} parameter is now invalid. Please select a new field.',
values: {
fieldParameter: '"field"',
fieldParameter: `"${fieldName}"`,
},
}
)
Expand Down

0 comments on commit 1e86bfe

Please sign in to comment.