|
|
@@ -25,23 +25,16 @@ func NewInterceptor(name string, urlWhitelist map[string]int) grpc.UnaryServerIn |
|
|
|
logger.Logger.Debug(name, zap.Any("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
|
zap.Any("resp", resp), zap.Error(err)) |
|
|
|
|
|
|
|
//resp, err = handleWithAuth(ctx, req, info, handler, urlWhitelist) |
|
|
|
//logger.Logger.Debug(name, zap.Any("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
|
// zap.Any("resp", resp), zap.Error(err)) |
|
|
|
|
|
|
|
s, _ := status.FromError(err) |
|
|
|
if s.Code() != 0 && s.Code() < 1000 { |
|
|
|
md, _ := metadata.FromIncomingContext(ctx) |
|
|
|
logger.Logger.Error(name, zap.String("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
|
zap.Any("resp", resp), zap.Error(err), zap.String("stack", gerrors.GetErrorStack(s))) |
|
|
|
} |
|
|
|
|
|
|
|
resp, err = handleWithAuth(ctx, req, info, handler, urlWhitelist) |
|
|
|
logger.Logger.Debug(name, zap.Any("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
|
zap.Any("resp", resp), zap.Error(err)) |
|
|
|
|
|
|
|
ss, _ := status.FromError(err) |
|
|
|
if ss.Code() != 0 && ss.Code() < 1000 { |
|
|
|
md, _ := metadata.FromIncomingContext(ctx) |
|
|
|
logger.Logger.Error(name, zap.String("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
|
zap.Any("resp", resp), zap.Error(err), zap.String("stack", gerrors.GetErrorStack(ss))) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|