From c0147297b728e28658c97557ed2d2e6ce67b6498 Mon Sep 17 00:00:00 2001 From: Kristina Durivage Date: Thu, 11 Dec 2025 13:27:13 -0600 Subject: [PATCH] fix the error type --- .../app/features/correlations/CorrelationsPageWrapper.tsx | 2 +- public/app/features/correlations/useCorrelationsK8s.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/app/features/correlations/CorrelationsPageWrapper.tsx b/public/app/features/correlations/CorrelationsPageWrapper.tsx index a8f335d3b48..c9c15a45d31 100644 --- a/public/app/features/correlations/CorrelationsPageWrapper.tsx +++ b/public/app/features/correlations/CorrelationsPageWrapper.tsx @@ -49,7 +49,7 @@ function CorrelationsPageAppPlatform() { totalCount: totalItems.current, }} isLoading={isLoading} - error={error as Error} + error={error} removeFn={(params: RemoveCorrelationParams) => { const deleteData = deleteCorrelation({ name: params.uid }); return deleteData.unwrap(); diff --git a/public/app/features/correlations/useCorrelationsK8s.ts b/public/app/features/correlations/useCorrelationsK8s.ts index 13238f96dd4..e74ed19ad7f 100644 --- a/public/app/features/correlations/useCorrelationsK8s.ts +++ b/public/app/features/correlations/useCorrelationsK8s.ts @@ -62,11 +62,16 @@ export const useCorrelationsK8s = (limit = 100, page: number) => { currentData !== undefined ? pagedData.map((item) => toEnrichedCorrelationDataK8s(item)).filter((i) => i !== undefined) : []; + let fmtedError = undefined; + + if (error !== undefined) { + fmtedError = new Error(error?.toString() ?? 'useListCorrelationQuery error'); + } return { currentData: enrichedCorrelations, isLoading, - error, + error: fmtedError, remainingItems: currentData?.metadata.remainingItemCount || 0, }; };