Skip to content

Commit

Permalink
Stop wrapping http error
Browse files Browse the repository at this point in the history
The error message provides no extra value, the original error provides
plenty of detail for example:

  Post "http://service.name:80/query": dial tcp 172.1.2.3:80: connect: connection refused
  • Loading branch information
pkqk committed Oct 29, 2024
1 parent 19bd569 commit 25724de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,8 @@ func (c *GraphQLClient) Request(ctx context.Context, url string, request *Reques
promServiceTimeoutErrorCounter.With(prometheus.Labels{
"service": url,
}).Inc()

// Return raw timeout error to allow caller to handle it since a
// downstream caller may want to retry, and they will have to jump
// through hoops to detect this error otherwise.
return traceErr(err)
}
return traceErr(fmt.Errorf("error during request: %w", err))
return traceErr(err)
}
defer res.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ e.g.
```json
{
"errors": {
"message": "error during request: Post \"http://localhost:8080/query\": context deadline exceeded",
"message": "Post \"http://localhost:8080/query\": context deadline exceeded",
"extensions": {
"selectionSet": "{ serviceB _bramble_id: id }"
},
Expand Down

0 comments on commit 25724de

Please sign in to comment.