Skip to content

Commit

Permalink
api-server-rest: Add actionable error message for ttrcp client
Browse files Browse the repository at this point in the history
Fixes: #379

Signed-off-by: Wang, Arron <[email protected]>
  • Loading branch information
arronwy committed Nov 3, 2023
1 parent e849dc8 commit f793afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api-server-rest/src/aa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ impl ApiHandler for AAClient {

impl AAClient {
pub fn new(aa_addr: &str, accepted_method: Vec<Method>) -> Result<Self> {
let inner = ttrpc::asynchronous::Client::connect(aa_addr)?;
let inner = ttrpc::asynchronous::Client::connect(aa_addr)
.context(format!("ttrpc connect to AA addr: {} failed!", aa_addr))?;
let client = AttestationAgentServiceClient::new(inner);

Ok(Self {
Expand Down
3 changes: 2 additions & 1 deletion api-server-rest/src/cdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ impl ApiHandler for CDHClient {

impl CDHClient {
pub fn new(cdh_addr: &str, accepted_method: Vec<Method>) -> Result<Self> {
let inner = ttrpc::asynchronous::Client::connect(cdh_addr)?;
let inner = ttrpc::asynchronous::Client::connect(cdh_addr)
.context(format!("ttrpc connect to CDH addr: {} failed!", cdh_addr))?;
let client = GetResourceServiceClient::new(inner);

Ok(Self {
Expand Down

0 comments on commit f793afc

Please sign in to comment.