From 490c630c9afbf43a5b02769336248d324d1e6546 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:39:47 +1100 Subject: [PATCH] [8.x] [React@18 failing test] fix visualize app - new charts library visualize area charts date histogram when no time filter interval errors should show error when calendar interval invalid (#196308) (#197198) # Backport This will backport the following commits from `main` to `8.x`: - [[React@18 failing test] fix visualize app - new charts library visualize area charts date histogram when no time filter interval errors should show error when calendar interval invalid (#196308)](https://github.com/elastic/kibana/pull/196308) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Anton Dosov --- .../data/common/search/aggs/buckets/date_histogram.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts index 66820ff0d3e94..314ee4d03042c 100644 --- a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts +++ b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts @@ -116,7 +116,14 @@ export const getDateHistogramBucketAgg = ({ dateFormat: getConfig('dateFormat'), 'dateFormat:scaled': getConfig('dateFormat:scaled'), }); - updateTimeBuckets(this, calculateBounds, buckets); + + try { + updateTimeBuckets(this, calculateBounds, buckets); + } catch (e) { + // swallow the error even though the agg is misconfigured + // eslint-disable-next-line no-console + console.error(e); + } return buckets; },