Skip to content

Commit b1c0abc

Browse files
committed
fix: display error that does not implement std::error:Error
1 parent fc8e1bb commit b1c0abc

File tree

1 file changed

+6
-2
lines changed
  • cvmassistants/quote-generator/src

1 file changed

+6
-2
lines changed

cvmassistants/quote-generator/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,13 @@ fn create_tdx_report(report_data: &tdx_attest_rs::tdx_report_data_t) -> Result<t
8080
let mut tdx_report = tdx_attest_rs::tdx_report_t {
8181
d: [0; REPORT_SIZE],
8282
};
83-
match tdx_attest_rs::tdx_att_get_report(Some(report_data), &mut tdx_report) {
83+
let result = tdx_attest_rs::tdx_att_get_report(Some(report_data), &mut tdx_report);
84+
match result {
8485
tdx_attest_rs::tdx_attest_error_t::TDX_ATTEST_SUCCESS => Ok(tdx_report),
85-
_ => Err(QuoteGeneratorError::TdxReportFailed),
86+
_ => {
87+
error!("Failed to get TDX report: {:?}", result);
88+
Err(QuoteGeneratorError::TdxReportFailed) // _tdx_attest_error_t does not implement std::error::Error
89+
}
8690
}
8791
}
8892

0 commit comments

Comments
 (0)