Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: expand submit certificate error details (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko authored and Marko Atanasievski committed Oct 3, 2023
1 parent 7638b5c commit a146e36
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/topos-tce-api/src/grpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,17 @@ impl ApiService for TceGrpcService {
Span::current().record("certificate_id", id.to_string());

let (sender, receiver) = oneshot::channel();
let certificate = match certificate.try_into() {
// FIXME: remove certificate cloning (may be a lot of data) when we
// resolve the issue with invalid certificate error
let certificate = match certificate.clone().try_into() {
Ok(c) => c,
Err(e) => {
error!("Invalid certificate: {e:?}");
return Err(Status::invalid_argument(
"Can't submit certificate: invalid certificate",
));
error!(
"Invalid certificate error: {e:?}, certificate: {certificate:?}"
);
return Err(Status::invalid_argument(format!(
"Can't submit invalid certificate: {e}"
)));
}
};

Expand Down

0 comments on commit a146e36

Please sign in to comment.