Skip to content

Commit efc5563

Browse files
committed
chore(Frontend): 🔊 Add error log about unhandle grpc error type
1 parent 5003b30 commit efc5563

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/utils/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ impl From<tonic::Status> for Error {
8181
fn from(value: tonic::Status) -> Self {
8282
use tonic::Code;
8383

84+
let context = value.message().to_owned();
8485
let kind = match value.code() {
8586
Code::NotFound => ErrorKind::NotFound,
8687
Code::Unauthenticated => ErrorKind::Unauthenticated,
@@ -90,11 +91,10 @@ impl From<tonic::Status> for Error {
9091
// this happened when grpc cannot find the rpc
9192
Code::Unimplemented => ErrorKind::ApiNotMatch,
9293
code => {
93-
logging::error!("{code}");
94+
logging::error!("unknown grpc error: {code}, {context}");
9495
ErrorKind::Internal
9596
}
9697
};
97-
let context = value.message().to_owned();
9898

9999
Self { kind, context }
100100
}

0 commit comments

Comments
 (0)