Skip to content

Commit

Permalink
return error processing back
Browse files Browse the repository at this point in the history
  • Loading branch information
requiemofthesouls authored and tiaguinho committed Nov 11, 2020
1 parent b502592 commit d1d0ad1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (p *process) doRequest(url string) ([]byte, error) {
}

if resp.StatusCode < 200 || resp.StatusCode >= 400 {
return nil, fmt.Errorf("Unexpected status code: %d", resp.StatusCode)
return nil, errors.New("unexpected status code: " + resp.Status)
}

return ioutil.ReadAll(resp.Body)
Expand Down
2 changes: 1 addition & 1 deletion soap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestProcess_doRequest(t *testing.T) {
t.Errorf("err can't be nil")
}

if err != nil && err.Error() != "Unexpected status code: 404" {
if err != nil && err.Error() != "unexpected status code: 404 Not Found" {
t.Errorf("unexpected error: %s", err)
}
}

0 comments on commit d1d0ad1

Please sign in to comment.