(null);
useEffect(() => {
@@ -691,9 +691,13 @@ function useReportingState(errors: UserMessage[]): {
}
}, [isRenderComplete, errors]);
- return { isRenderComplete, setIsRenderComplete, hasDynamicError, setDynamicError, nodeRef };
+ return { isRenderComplete, setIsRenderComplete, hasRequestError, setHasRequestError, nodeRef };
}
+const dataLoadingErrorTitle = i18n.translate('xpack.lens.editorFrame.dataFailure', {
+ defaultMessage: `An error occurred when loading data`,
+});
+
export const VisualizationWrapper = ({
expression,
lensInspector,
@@ -730,13 +734,14 @@ export const VisualizationWrapper = ({
const searchContext = useLensSelector(selectExecutionContextSearch);
// Used for reporting
- const { isRenderComplete, hasDynamicError, setIsRenderComplete, setDynamicError, nodeRef } =
+ const { isRenderComplete, hasRequestError, setIsRenderComplete, setHasRequestError, nodeRef } =
useReportingState(errors);
const onRenderHandler = useCallback(() => {
+ setHasRequestError(false);
setIsRenderComplete(true);
onRender$();
- }, [setIsRenderComplete, onRender$]);
+ }, [onRender$, setHasRequestError, setIsRenderComplete]);
const searchSessionId = useLensSelector(selectSearchSessionId);
@@ -759,17 +764,13 @@ export const VisualizationWrapper = ({
);
}
- const dataLoadingErrorTitle = i18n.translate('xpack.lens.editorFrame.dataFailure', {
- defaultMessage: `An error occurred when loading data`,
- });
-
return (
;
+ return (
+ setHasRequestError(true)}
+ />
+ );
}}
/>