From 1e86bfe2970647dceb64e3826a564754211056f9 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 28 Sep 2020 15:37:35 +0200 Subject: [PATCH] Improve error message --- src/plugins/data/common/search/aggs/param_types/field.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/data/common/search/aggs/param_types/field.ts b/src/plugins/data/common/search/aggs/param_types/field.ts index 492294bdf4e5f..93e1baaebb308 100644 --- a/src/plugins/data/common/search/aggs/param_types/field.ts +++ b/src/plugins/data/common/search/aggs/param_types/field.ts @@ -84,7 +84,7 @@ 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', @@ -92,7 +92,7 @@ export class FieldParamType extends BaseParamType { defaultMessage: 'Saved {fieldParameter} parameter is now invalid. Please select a new field.', values: { - fieldParameter: '"field"', + fieldParameter: `"${fieldName}"`, }, } )