grafana/public/app/features/explore/ResponseErrorContainer.tsx
Giordano Ricci 5f48d0641b
Explore: prevent eplore from hiding errors containing refId (#39504)
* Explore: prevent eplore from hiding errors containing refId

* Update public/app/features/explore/ResponseErrorContainer.tsx

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-22 10:33:31 +01:00

17 lines
585 B
TypeScript

import React from 'react';
import { useSelector } from 'react-redux';
import { ExploreId, StoreState } from '../../types';
import { LoadingState } from '@grafana/data';
import { ErrorContainer } from './ErrorContainer';
interface Props {
exploreId: ExploreId;
}
export function ResponseErrorContainer(props: Props) {
const queryResponse = useSelector((state: StoreState) => state.explore[props.exploreId]?.queryResponse);
const queryError = queryResponse?.state === LoadingState.Error ? queryResponse?.error : undefined;
return <ErrorContainer queryError={queryError} />;
}