From 4d4804900bf53998de96fb8abf720fe093c3025f Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Sun, 28 Apr 2024 16:02:58 -0700 Subject: [PATCH] add error data frame Signed-off-by: Paul Sebastian --- src/plugins/data/common/data_frames/types.ts | 4 ++++ src/plugins/data/common/data_frames/utils.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/data/common/data_frames/types.ts b/src/plugins/data/common/data_frames/types.ts index 551243e3b405..ad017580ed1a 100644 --- a/src/plugins/data/common/data_frames/types.ts +++ b/src/plugins/data/common/data_frames/types.ts @@ -39,3 +39,7 @@ export interface PartialDataFrame extends Omit { export interface IDataFrameWithAggs extends IDataFrame { aggs: DataFrameAgg[] | null; } + +export interface IDataFrameError { + error: Error; +} diff --git a/src/plugins/data/common/data_frames/utils.ts b/src/plugins/data/common/data_frames/utils.ts index acc23a4d3c56..e84a34b3e080 100644 --- a/src/plugins/data/common/data_frames/utils.ts +++ b/src/plugins/data/common/data_frames/utils.ts @@ -11,7 +11,7 @@ import { SearchResponse } from 'elasticsearch'; import datemath from '@elastic/datemath'; -import { IDataFrame, IDataFrameWithAggs, PartialDataFrame } from './types'; +import { IDataFrame, IDataFrameError, IDataFrameWithAggs, PartialDataFrame } from './types'; import { IFieldType } from './fields'; import { IndexPatternFieldMap, IndexPatternSpec } from '../index_patterns'; import { IOpenSearchDashboardsSearchRequest } from '../search'; @@ -20,7 +20,7 @@ const name = 'data_frame'; export interface IDataFrameResponse extends SearchResponse { type: typeof name; - body: IDataFrame | IDataFrameWithAggs; + body: IDataFrame | IDataFrameWithAggs | IDataFrameError; took: number; }