Skip to content

Commit

Permalink
chore(Frontend): 🔊 Add error log about unhandle grpc error type
Browse files Browse the repository at this point in the history
  • Loading branch information
KAIYOHUGO committed Aug 30, 2024
1 parent 5003b30 commit efc5563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/utils/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl From<tonic::Status> for Error {
fn from(value: tonic::Status) -> Self {
use tonic::Code;

let context = value.message().to_owned();
let kind = match value.code() {
Code::NotFound => ErrorKind::NotFound,
Code::Unauthenticated => ErrorKind::Unauthenticated,
Expand All @@ -90,11 +91,10 @@ impl From<tonic::Status> for Error {
// this happened when grpc cannot find the rpc
Code::Unimplemented => ErrorKind::ApiNotMatch,
code => {
logging::error!("{code}");
logging::error!("unknown grpc error: {code}, {context}");
ErrorKind::Internal
}
};
let context = value.message().to_owned();

Self { kind, context }
}
Expand Down

0 comments on commit efc5563

Please sign in to comment.