Skip to content

Commit 864ea0f

Browse files
committed
ipn/yegor: if error msg is empty, use body
1 parent 1666534 commit 864ea0f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

intra/ipn/rpn/yegor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,10 @@ func wsErr2(res *http.Response, op string) (*WsErrorResponse, error) {
12031203
return nil, log.EE("ws: %s: (%d) unmarshal err: %v; body: %s", op, code, err, truncate2k(body))
12041204
}
12051205

1206+
if len(wsErr.Msg) <= 0 {
1207+
wsErr.Msg = string(truncate2k(body))
1208+
}
1209+
12061210
return &wsErr, log.EE("ws: %s: (%d) error %d: %s; why: %s", op, code, wsErr.Code, wsErr.Msg, wsErr.Desc)
12071211
}
12081212

0 commit comments

Comments
 (0)