Skip to content

Commit 5dcac7b

Browse files
committed
Fix ChromaApi Http Server/Client exception message check
Signed-off-by: Ilayaperumal Gopinathan <[email protected]>
1 parent c4acf95 commit 5dcac7b

File tree

1 file changed

+3
-1
lines changed
  • vector-stores/spring-ai-chroma-store/src/main/java/org/springframework/ai/chroma/vectorstore

1 file changed

+3
-1
lines changed

vector-stores/spring-ai-chroma-store/src/main/java/org/springframework/ai/chroma/vectorstore/ChromaApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ public Collection getCollection(String tenantName, String databaseName, String c
228228
}
229229
catch (HttpServerErrorException | HttpClientErrorException e) {
230230
String msg = this.getErrorMessage(e);
231-
if (String.format("Collection [%s] does not exist", collectionName).equals(msg)) {
231+
// Handle both "does not exist" and "does not exists" variants from Chroma API
232+
if (String.format("Collection [%s] does not exist", collectionName).equals(msg)
233+
|| String.format("Collection [%s] does not exists", collectionName).equals(msg)) {
232234
return null;
233235
}
234236
throw new RuntimeException(msg, e);

0 commit comments

Comments
 (0)