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, }; };