Skip to content

Commit 553e1ff

Browse files
committed
show error message
1 parent 9a56398 commit 553e1ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/compass-indexes/src/modules/create-index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,15 @@ export const fetchIndexSuggestions = ({
443443
fetchingSuggestionsError: null,
444444
indexSuggestionsState: 'success',
445445
});
446-
} catch (e) {
447-
console.log('e', e.message);
446+
} catch (e: unknown) {
448447
dispatch({
449448
type: ActionTypes.SuggestedIndexesFetched,
450449
sampleDocs: sampleDocuments,
451450
indexSuggestions: null,
452451
fetchingSuggestionsError:
453-
'Error parsing query. Please follow query structure.',
452+
e instanceof Error
453+
? e.message
454+
: 'Error parsing query. Please follow query structure.',
454455
indexSuggestionsState: 'error',
455456
});
456457
}

0 commit comments

Comments
 (0)