diff --git a/chromadb/errors.py b/chromadb/errors.py index ec8c77aa818..9a3f5d091ab 100644 --- a/chromadb/errors.py +++ b/chromadb/errors.py @@ -194,4 +194,7 @@ def name(cls) -> str: "VersionMismatchError": VersionMismatchError, "RateLimitError": RateLimitError, "AuthError": ChromaAuthError, + "UniqueConstraintError": UniqueConstraintError, + "QuotaError": QuotaError, + "InternalError": InternalError, } diff --git a/chromadb/test/api/test_collection.py b/chromadb/test/api/test_collection.py index e367ebc21f8..dee01300e2a 100644 --- a/chromadb/test/api/test_collection.py +++ b/chromadb/test/api/test_collection.py @@ -1,4 +1,5 @@ from chromadb.api import ClientAPI +from chromadb.errors import UniqueConstraintError def test_duplicate_collection_create( @@ -21,7 +22,7 @@ def test_duplicate_collection_create( assert False, "Expected exception" except Exception as e: print("Collection creation failed as expected with error ", e) - assert "already exists" in e.args[0] or "UniqueConstraintError" in e.args[0] + assert "already exists" in e.args[0] or isinstance(e, UniqueConstraintError) def test_not_existing_collection_delete(