grpc-rust icon indicating copy to clipboard operation
grpc-rust copied to clipboard

Client recieve diferent error type and message

Open FourLeafTec opened this issue 5 years ago • 0 comments

In Server return a GrpcMessageError to client.

    fn send_bulk_encu(
        &self,
        _m: grpc::RequestOptions,
        req: BulkEncu,
    ) -> grpc::SingleResponse<Empty> {
        grpc::SingleResponse::err(grpc::Error::GrpcMessage(grpc::GrpcMessageError {
            grpc_status: 2,
            grpc_message: String::from("Some custom error msg"),
        }))
    }

BUT in client, I recieve a Http(CodeError(InternalError)) with message "http error: Encountered HTTP named error"

match client.send_bulk_encu(opt, data).wait_drop_metadata() {
    Ok(_) => (),
    Err(e) => {
        println!("{}",e);
        ()
    }
}

FourLeafTec avatar Nov 18 '19 13:11 FourLeafTec