Skip to content

Commit

Permalink
fix: Fix AttributeError within gRPC error handling (#3470)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkundu1 authored Nov 12, 2024
1 parent a5ed481 commit dc8b347
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ansys/fluent/core/services/interceptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ def _intercept_call(
) -> Any:
response = continuation(client_call_details, request)
if response.exception() is not None and response.code() != grpc.StatusCode.OK:
grpc_ex = response.exception()
ex = RuntimeError(grpc_ex.details())
ex.__context__ = grpc_ex
raise ex from None
ex = response.exception()
new_ex = RuntimeError(
ex.details() if isinstance(ex, grpc.RpcError) else str(ex)
)
new_ex.__context__ = ex
raise new_ex from None
return response

def intercept_unary_unary(
Expand Down

0 comments on commit dc8b347

Please sign in to comment.