Closed kbamponsem closed 2 years ago
This PR fixes ambiguous error message when executing integration tests in software (SW) mode.
Describe your changes in detail
It adds a new check code for FAILED_PRECONDITION to the lists of GRPC error checks on the client side.
FAILED_PRECONDITION
def check_rpc_exception(rpc_error): if rpc_error.code() == grpc.StatusCode.CANCELLED: return f"Cancelled GRPC call: code={rpc_error.code()} message={rpc_error.details()}" elif rpc_error.code() == grpc.StatusCode.UNAVAILABLE: return f"Failed to connect to GRPC server: code={rpc_error.code()} message={rpc_error.details()}" elif rpc_error.code() == grpc.StatusCode.UNIMPLEMENTED: return f"Incompatible client/server versions, code={rpc_error.code()} message={rpc_error.details()}" elif rpc_error.code() == grpc.StatusCode.FAILED_PRECONDITION: return f"Attestation is not available. Running in Simulation Mode, code={rpc_error.code()} message={rpc_error.details()}" else: return ( f"Received RPC error: code={rpc_error.code()} message={rpc_error.details()}" )
if cfg!(SGX_MODE = "SW") { return Err(Status::failed_precondition( "Attestation is not available. Running in Simulation Mode", )); }
The types of changes must be deduced from the labels of the related issues. Please consider providing these further details.
It was tested in a simulation environment and the proper error message was witnessed.
Description
This PR fixes ambiguous error message when executing integration tests in software (SW) mode.
Describe your changes in detail
It adds a new check code for
FAILED_PRECONDITION
to the lists of GRPC error checks on the client side.Type of change
The types of changes must be deduced from the labels of the related issues. Please consider providing these further details.
How Has This Been Tested?
It was tested in a simulation environment and the proper error message was witnessed.
Checklist: