Skip to content

Commit

Permalink
show an error on 403 only if api key exists but not valid (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
trean authored Dec 22, 2023
1 parent 47611c5 commit 1870621
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/Collections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ function Collections() {
setRawCollections(collections.collections.sort((a, b) => a.name.localeCompare(b.name)));
setErrorMessage(null);
} catch (error) {
setErrorMessage(error.message);
if (error.status === 403 || error.status === 401) {
if (qdrantClient.getApiKey()) {
setErrorMessage('Your API key is invalid. Please, set a new one.');
}
} else {
setErrorMessage(error.message);
}
setRawCollections(null);
}
}
Expand Down

0 comments on commit 1870621

Please sign in to comment.