Skip to content

Commit

Permalink
fix: show document fetch error
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpedemonte committed Jan 19, 2024
1 parent 0cb18df commit 299b0cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/discovery-search-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -202,7 +202,9 @@ function PreviewPage() {
tooltipAlignment="start"
/>
</div>
{isLoading ? (
{isError ? (
<div>Unable to fetch document: {error.toString()}</div>
) : isLoading ? (
<Loading className={`${settings.prefix}--search-app__loading`} />
) : (
<Tabs
Expand Down

0 comments on commit 299b0cc

Please sign in to comment.