From efc55639956c2134b8f96ff6aeb50c52ee85ac17 Mon Sep 17 00:00:00 2001 From: kaiyohugo <41114603+KAIYOHUGO@users.noreply.github.com> Date: Sat, 31 Aug 2024 00:10:06 +0800 Subject: [PATCH] chore(Frontend): :loud_sound: Add error log about unhandle grpc error type --- frontend/src/utils/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/error.rs b/frontend/src/utils/error.rs index c5a5fa9..d7a7f44 100644 --- a/frontend/src/utils/error.rs +++ b/frontend/src/utils/error.rs @@ -81,6 +81,7 @@ impl From 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, @@ -90,11 +91,10 @@ impl From 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 } }