Skip to content

Commit

Permalink
Clean use
Browse files Browse the repository at this point in the history
  • Loading branch information
ipetr0v committed Mar 31, 2020
1 parent 588d326 commit e05b00b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions oak/server/rust/oak_runtime/src/node/grpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use protobuf::Message;
use protobuf::well_known_types::Any;

use oak_abi::{ChannelReadStatus, OakStatus};
use oak::grpc::{GrpcResponse, GrpcRequest};
use oak::io::error_from_nonok_status;
use oak::grpc::GrpcRequest;

use crate::Handle;
use crate::{NodeId, RuntimeRef};
Expand Down Expand Up @@ -220,17 +219,17 @@ impl GrpcService {
// Send a message to the temporary channel that will be read by the Oak node.
if let Err(oak_status) = self.runtime.channel_write(self.node_id, request_writer, message) {
let error = format!(
"Could not write message to the terporary gRPC server channel: {}",
error_from_nonok_status(oak_status)
"Could not write message to the terporary gRPC server channel: {:?}",
oak_status
);
return Err(error);
}

// Send a notification message (with attached handles) to the Oak node.
if let Err(oak_status) = self.runtime.channel_write(self.node_id, self.writer, notification) {
let error = format!(
"Could not write gRPC server notification message: {}",
error_from_nonok_status(oak_status)
"Could not write gRPC server notification message: {:?}",
oak_status
);
return Err(error);
}
Expand All @@ -250,8 +249,8 @@ impl GrpcService {
},
Err(oak_status) => {
let error = format!(
"Could not read temporary gRPC channel: {}",
oak::io::error_from_nonok_status(oak_status)
"Could not read temporary gRPC channel: {:?}",
oak_status
);
Err(error)
},
Expand All @@ -266,8 +265,8 @@ impl GrpcService {
},
Err(oak_status) => {
let error = format!(
"Could not wait on the temporary gRPC channels: {}",
oak::io::error_from_nonok_status(oak_status)
"Could not wait on the temporary gRPC channels: {:?}",
oak_status
);
Err(error)
},
Expand Down

0 comments on commit e05b00b

Please sign in to comment.