Skip to content

Commit fa97bd7

Browse files
authored
Merge pull request #60 from hunjixin/feat/add_error_msg
add error msg for debug
2 parents 45ea43a + a1ec7cb commit fa97bd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func httpClient(ctx context.Context, addr string, namespace string, outs []inter
167167
var resp clientResponse
168168

169169
if err := json.NewDecoder(httpResp.Body).Decode(&resp); err != nil {
170-
return clientResponse{}, xerrors.Errorf("unmarshaling response: %w", err)
170+
return clientResponse{}, xerrors.Errorf("http status %s unmarshaling response: %w", httpResp.Status, err)
171171
}
172172

173173
if resp.ID != *cr.req.ID {
@@ -189,7 +189,7 @@ func httpClient(ctx context.Context, addr string, namespace string, outs []inter
189189
func websocketClient(ctx context.Context, addr string, namespace string, outs []interface{}, requestHeader http.Header, config Config) (ClientCloser, error) {
190190
connFactory := func() (*websocket.Conn, error) {
191191
conn, _, err := websocket.DefaultDialer.Dial(addr, requestHeader)
192-
return conn, err
192+
return conn, xerrors.Errorf("cannot dial address %s for %w", addr, err)
193193
}
194194

195195
if config.proxyConnFactory != nil {

0 commit comments

Comments
 (0)