Unwrap error in Amazon validator

In amazon/validator.go, an error was being wrapped by fmt.Errorf("%v",
err). That discards any type information about the returned error;
returning err lets the callers inspect the exact error returned by the
HTTP client.

The test had to change to do similar inspection.
This commit is contained in:
Owen
2019-04-24 11:36:47 -04:00
parent 46a2f52ca6
commit 92d56725f7
2 changed files with 11 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ func (c *Client) Verify(ctx context.Context, userID string, receiptID string) (I
resp, err := c.httpCli.Do(req)
if err != nil {
return result, fmt.Errorf("%v", err)
return result, err
}
defer resp.Body.Close()