added re-run search indexing banner for es exception on explore page (#15120)

* added re-run search indexing banner for es exception

* minor change
This commit is contained in:
Abhishek Porwal 2024-02-12 16:32:27 +05:30 committed by GitHub
parent bf6fd926f3
commit b3401a32de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -91,4 +91,6 @@ export const COMMON_FILTERS_FOR_DIFFERENT_TABS = [
export const FAILED_TO_FIND_INDEX_ERROR = 'Failed to to find index';
export const ES_EXCEPTION_SHARDS_FAILED = 'reason=all shards failed';
export const SEARCH_INDEXING_APPLICATION = 'SearchIndexingApplication';

View File

@ -36,6 +36,7 @@ import { useTourProvider } from '../../components/TourProvider/TourProvider';
import { getExplorePath, PAGE_SIZE } from '../../constants/constants';
import {
COMMON_FILTERS_FOR_DIFFERENT_TABS,
ES_EXCEPTION_SHARDS_FAILED,
FAILED_TO_FIND_INDEX_ERROR,
INITIAL_SORT_FIELD,
} from '../../constants/explore.constants';
@ -393,7 +394,10 @@ const ExplorePageV1: FunctionComponent = () => {
}),
])
.catch((error) => {
if (error.response?.data.message.includes(FAILED_TO_FIND_INDEX_ERROR)) {
if (
error.response?.data.message.includes(FAILED_TO_FIND_INDEX_ERROR) ||
error.response?.data.message.includes(ES_EXCEPTION_SHARDS_FAILED)
) {
setShowIndexNotFoundAlert(true);
} else {
showErrorToast(error);