From f45f62c4b11450056e07fa26e7c37a597adee952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=83=D1=81=D0=BE=D0=B2=20=D0=9F=D0=B0?= =?UTF-8?q?=D0=B2=D0=B5=D0=BB=20=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B5=D0=B2?= =?UTF-8?q?=D0=B8=D1=87?= Date: Tue, 8 Jul 2025 17:19:44 +0300 Subject: [PATCH 1/3] MSP-5800 added stack trace to error --- proxy/grpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/grpc.go b/proxy/grpc.go index 0fec95f..7a86cc9 100644 --- a/proxy/grpc.go +++ b/proxy/grpc.go @@ -131,7 +131,7 @@ func (p Grpc) handleError(err error, w http.ResponseWriter) error { return httperrors.New( statusCode, status.Message(), - status.Err(), + errors.Wrap(err, "unhandled gRPC error"), ) } From 26691b99de20dee78be4382a8b7a159125b7427d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=83=D1=81=D0=BE=D0=B2=20=D0=9F=D0=B0?= =?UTF-8?q?=D0=B2=D0=B5=D0=BB=20=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B5=D0=B2?= =?UTF-8?q?=D0=B8=D1=87?= Date: Tue, 8 Jul 2025 17:21:16 +0300 Subject: [PATCH 2/3] MSP-5800 bump version to 5.2.10 --- .version | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.version b/.version index 485d792..b4e0879 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -5.2.9 \ No newline at end of file +5.2.10 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b74c0..90a1fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### v5.2.10 +* добавлен контекст ошибки для grpc ### v5.2.9 * взаимодействие напрямую с `redis` заменено на взаимодействие с `isp-lock-service` ### v5.2.8 From 52d8504089bcad22b669b50f8d5533183468db1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D1=80=D1=83=D1=81=D0=BE=D0=B2=20=D0=9F=D0=B0?= =?UTF-8?q?=D0=B2=D0=B5=D0=BB=20=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B5=D0=B2?= =?UTF-8?q?=D0=B8=D1=87?= Date: Wed, 9 Jul 2025 09:48:39 +0300 Subject: [PATCH 3/3] MSP-5800 refac err return --- proxy/grpc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/grpc.go b/proxy/grpc.go index 7a86cc9..04f4b35 100644 --- a/proxy/grpc.go +++ b/proxy/grpc.go @@ -95,13 +95,13 @@ func (p Grpc) Handle(ctx *request.Context) error { Body: &isp.Message_BytesBody{BytesBody: body}, }) if err != nil { - return p.handleError(err, ctx.ResponseWriter()) + return p.handleError(err, ctx.ResponseWriter(), ctx.Endpoint()) } return p.writeResponse(http.StatusOK, result.GetBytesBody(), requestId, ctx.ResponseWriter()) } -func (p Grpc) handleError(err error, w http.ResponseWriter) error { +func (p Grpc) handleError(err error, w http.ResponseWriter, endpoint string) error { status, ok := status.FromError(err) if !ok { return httperrors.New( @@ -131,7 +131,7 @@ func (p Grpc) handleError(err error, w http.ResponseWriter) error { return httperrors.New( statusCode, status.Message(), - errors.Wrap(err, "unhandled gRPC error"), + errors.WithMessagef(err, "isp-routing-service: proxy '%s'", endpoint), ) }