Skip to content

Commit

Permalink
return weaviate traceback too when query error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm207 committed Feb 29, 2024
1 parent 3f8fa4c commit f35ef05
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _query_paginated(self, properties: List[str]):
result = self._collection.iterator(include_vector=True, return_properties=properties)
except weaviate.exceptions.WeaviateQueryError as e:
msg = f"Failed to query documents in Weaviate. Error: {e.message}"
raise DocumentStoreError(msg) from None
raise DocumentStoreError(msg) from e
return list(result)

def _query_with_filters(self, filters: weaviate.collections.classes.filters.Filter) -> List[Dict[str, Any]]:
Expand All @@ -255,7 +255,7 @@ def _query_with_filters(self, filters: weaviate.collections.classes.filters.Filt
)
except weaviate.exceptions.WeaviateQueryError as e:
msg = f"Failed to query documents in Weaviate. Error: {e.message}"
raise DocumentStoreError(msg) from None
raise DocumentStoreError(msg) from e

return result.objects

Expand Down

0 comments on commit f35ef05

Please sign in to comment.