|
@@ -25,16 +25,25 @@ 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), |
|
|
logger.Logger.Debug(name, zap.Any("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
zap.Any("resp", resp), zap.Error(err)) |
|
|
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) |
|
|
s, _ := status.FromError(err) |
|
|
if s.Code() != 0 && s.Code() < 1000 { |
|
|
if s.Code() != 0 && s.Code() < 1000 { |
|
|
md, _ := metadata.FromIncomingContext(ctx) |
|
|
md, _ := metadata.FromIncomingContext(ctx) |
|
|
logger.Logger.Error(name, zap.String("method", info.FullMethod), zap.Any("md", md), zap.Any("req", req), |
|
|
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))) |
|
|
zap.Any("resp", resp), zap.Error(err), zap.String("stack", gerrors.GetErrorStack(s))) |
|
|
} |
|
|
} |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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))) |
|
|
|
|
|
} |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|