Skip to content

Commit

Permalink
cdh & image-rs: add debug patch
Browse files Browse the repository at this point in the history
Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Jul 11, 2024
1 parent 26056ba commit 429002c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
9 changes: 6 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions confidential-data-hub/hub/src/bin/ttrpc_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ impl GetResourceService for Server {
error!("[ttRPC CDH] GetResource :\n{detailed_error}");
let mut status = Status::new();
status.set_code(Code::INTERNAL);
status.set_message("[CDH] [ERROR]: Get Resource failed".into());
status.set_message(format!(
"[CDH] [ERROR]: Get Resource failed, err: {detailed_error}"
));
Error::RpcStatus(status)
})?;

Expand Down Expand Up @@ -136,7 +138,9 @@ impl KeyProviderService for Server {
error!("[ttRPC CDH] UnWrapKey :\n{detailed_error}");
let mut status = Status::new();
status.set_code(Code::INTERNAL);
status.set_message("[CDH] [ERROR]: UnwrapKey failed".to_string());
status.set_message(format!(
"[CDH] [ERROR]: UnwrapKey failed, err: {detailed_error}"
));
Error::RpcStatus(status)
})?;

Expand Down
7 changes: 1 addition & 6 deletions image-rs/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

use anyhow::{anyhow, bail, Result};
use log::warn;
use oci_distribution::manifest::{OciDescriptor, OciImageManifest};
use oci_distribution::secrets::RegistryAuth;
use oci_distribution::Reference;
Expand Down Expand Up @@ -229,11 +228,7 @@ impl ImageClient {
{
Ok(cred) => cred,
Err(e) => {
warn!(
"get credential failed, use Anonymous auth instead: {}",
e.to_string()
);
RegistryAuth::Anonymous
bail!("Failed to get registry auth: {:?}", e)
}
}
}
Expand Down

0 comments on commit 429002c

Please sign in to comment.