Important exceptions like “the collection doesn’t exists” should be agnostic of the storage type, to avoid the need to catch several exception types.
For instance, this code would be preferable and wouldn’t need changes when swapping storage type:
Try { … }
catch (Microsoft.Extensions.VectorData.CollectionNotFoundException e)
{ … }
as opposed to:
Try { … }
catch (Exception e) when (e is Qdrant.CollectionNotFoundException or Postgres.CollectionNotFoundException or AzureAiSearch.CollectionNotFoundException or Milvus.CollectionNotFoundException or ...)
{ … }
Important exceptions like “the collection doesn’t exists” should be agnostic of the storage type, to avoid the need to catch several exception types.
For instance, this code would be preferable and wouldn’t need changes when swapping storage type:
as opposed to: