Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
689f730a3e |
No files matched your search
@@ -1,3 +1,5 @@
|
|||||||
|
### v5.2.10
|
||||||
|
* добавлен контекст ошибки для grpc
|
||||||
### v5.2.9
|
### v5.2.9
|
||||||
* взаимодействие напрямую с `redis` заменено на взаимодействие с `isp-lock-service`
|
* взаимодействие напрямую с `redis` заменено на взаимодействие с `isp-lock-service`
|
||||||
### v5.2.8
|
### v5.2.8
|
||||||
|
|||||||
+3
-3
@@ -95,13 +95,13 @@ func (p Grpc) Handle(ctx *request.Context) error {
|
|||||||
Body: &isp.Message_BytesBody{BytesBody: body},
|
Body: &isp.Message_BytesBody{BytesBody: body},
|
||||||
})
|
})
|
||||||
if err != nil {
|
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())
|
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)
|
status, ok := status.FromError(err)
|
||||||
if !ok {
|
if !ok {
|
||||||
return httperrors.New(
|
return httperrors.New(
|
||||||
@@ -131,7 +131,7 @@ func (p Grpc) handleError(err error, w http.ResponseWriter) error {
|
|||||||
return httperrors.New(
|
return httperrors.New(
|
||||||
statusCode,
|
statusCode,
|
||||||
status.Message(),
|
status.Message(),
|
||||||
status.Err(),
|
errors.WithMessagef(err, "isp-routing-service: proxy '%s'", endpoint),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user