Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jan 24, 2023
1 parent 9dd6a03 commit 3af71df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/opentelemetry-jaeger-tracing/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewClient() *Client {
SetCommonErrorResult(&APIError{}).
// Handle common exceptions in response middleware.
OnAfterResponse(func(client *req.Client, resp *req.Response) error {
if resp.Err != nil { // There is an underlying error, e.g. network error or unmarshal error(SetResult or SetError was invoked before).
if resp.Err != nil { // There is an underlying error, e.g. network error or unmarshal error (SetSuccessResult or SetErrorResult was invoked before).
if dump := resp.Dump(); dump != "" { // Append dump content to original underlying error to help troubleshoot.
resp.Err = fmt.Errorf("error: %s\nraw content:\n%s", resp.Err.Error(), resp.Dump())
}
Expand Down Expand Up @@ -167,8 +167,8 @@ func (c *Client) ListUserRepo(ctx context.Context, username string, page int) (r
"sort": "updated",
"direction": "desc",
}).
SetSuccessResult(&repos).
Do(withAPIName(ctx, "ListUserRepo")).Err
Do(withAPIName(ctx, "ListUserRepo")).
Into(&repos)
return
}

Expand Down

0 comments on commit 3af71df

Please sign in to comment.