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

Commit a146e36

Browse files
atanmarkoMarko Atanasievski
authored and
Marko Atanasievski
committed
fix: expand submit certificate error details (#320)
1 parent 7638b5c commit a146e36

File tree

1 file changed

+9
-5
lines changed
  • crates/topos-tce-api/src/grpc

1 file changed

+9
-5
lines changed

crates/topos-tce-api/src/grpc/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,17 @@ impl ApiService for TceGrpcService {
8989
Span::current().record("certificate_id", id.to_string());
9090

9191
let (sender, receiver) = oneshot::channel();
92-
let certificate = match certificate.try_into() {
92+
// FIXME: remove certificate cloning (may be a lot of data) when we
93+
// resolve the issue with invalid certificate error
94+
let certificate = match certificate.clone().try_into() {
9395
Ok(c) => c,
9496
Err(e) => {
95-
error!("Invalid certificate: {e:?}");
96-
return Err(Status::invalid_argument(
97-
"Can't submit certificate: invalid certificate",
98-
));
97+
error!(
98+
"Invalid certificate error: {e:?}, certificate: {certificate:?}"
99+
);
100+
return Err(Status::invalid_argument(format!(
101+
"Can't submit invalid certificate: {e}"
102+
)));
99103
}
100104
};
101105

0 commit comments

Comments
 (0)