Skip to content

Commit

Permalink
Merge pull request #5488 from oasisprotocol/ptrus/fix/response-err-fix
Browse files Browse the repository at this point in the history
rhp: don't prepend 'failed to read response' to module errors
  • Loading branch information
ptrus authored Nov 30, 2023
2 parents d8a4377 + f4b80e3 commit 0a79d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/5488.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rhp: don't prepend 'failed to read response' to runtime module errors
6 changes: 3 additions & 3 deletions go/runtime/host/protocol/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (c *connection) call(ctx context.Context, body *Body) (result *Body, err er
// Await a response.
resp, err := c.readResponse(ctx, respCh)
if err != nil {
return nil, fmt.Errorf("failed to read response: %w", err)
return nil, err
}

return resp, nil
Expand All @@ -349,9 +349,9 @@ func (c *connection) readResponse(ctx context.Context, respCh <-chan *Body) (*Bo

return resp, nil
case <-c.closeCh:
return nil, fmt.Errorf("connection closed")
return nil, fmt.Errorf("failed to read response: %w", fmt.Errorf("connection closed"))
case <-ctx.Done():
return nil, ctx.Err()
return nil, fmt.Errorf("failed to read response: %w", ctx.Err())
}
}

Expand Down

0 comments on commit 0a79d2f

Please sign in to comment.