From 299b0cc5a7c4a5be1d850888d8cdfdbe31d4f65c Mon Sep 17 00:00:00 2001 From: Javier Pedemonte Date: Fri, 19 Jan 2024 15:10:28 -0600 Subject: [PATCH] fix: show document fetch error --- examples/discovery-search-app/src/App.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/discovery-search-app/src/App.js b/examples/discovery-search-app/src/App.js index 1de7a8574..6027a9ea1 100644 --- a/examples/discovery-search-app/src/App.js +++ b/examples/discovery-search-app/src/App.js @@ -150,7 +150,7 @@ function PreviewPage() { const { selectedResult: { document: selectedDocument }, searchResponseStore: { data: searchResponse }, - fetchDocumentsResponseStore: { data: fetchDocumentResponse, isLoading } + fetchDocumentsResponseStore: { data: fetchDocumentResponse, isLoading, isError, error } } = useContext(SearchContext); const { fetchDocuments, setSelectedResult } = useContext(SearchApi); @@ -202,7 +202,9 @@ function PreviewPage() { tooltipAlignment="start" /> - {isLoading ? ( + {isError ? ( +
Unable to fetch document: {error.toString()}
+ ) : isLoading ? ( ) : (