Skip to content

Commit 0d0c02f

Browse files
committed
fix: include gRPC status code in WeaviateDeleteManyError messages (Fixes #1030)
Previously, batch delete failures produced unhelpful error messages like 'Query call with protocol GRPC delete failed with message unavailable.' without indicating the gRPC status code. Now the error includes the status code name (e.g., [UNAVAILABLE], [DEADLINE_EXCEEDED]) to help users diagnose whether the failure is due to server overload, timeout, or other gRPC-level issues. Affects both sync (ConnectionSync.grpc_batch_delete) and async (ConnectionAsync.grpc_batch_delete) code paths. Signed-off-by: rtmalikian <rtmalikian@gmail.com>
1 parent 17a9887 commit 0d0c02f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

weaviate/connect/v4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def grpc_batch_delete(
10521052
error = cast(Call, e)
10531053
if error.code() == StatusCode.PERMISSION_DENIED:
10541054
raise InsufficientPermissionsError(error)
1055-
raise WeaviateDeleteManyError(str(error.details()))
1055+
raise WeaviateDeleteManyError(f"[{error.code().name}] {error.details()}")
10561056

10571057
def grpc_tenants_get(
10581058
self, request: tenants_pb2.TenantsGetRequest
@@ -1232,7 +1232,7 @@ async def grpc_batch_delete(
12321232
except AioRpcError as e:
12331233
if e.code().name == PERMISSION_DENIED:
12341234
raise InsufficientPermissionsError(e)
1235-
raise WeaviateDeleteManyError(str(e))
1235+
raise WeaviateDeleteManyError(f"[{e.code().name}] {e.details()}")
12361236

12371237
async def grpc_batch_stream(
12381238
self,

0 commit comments

Comments
 (0)