Skip to content

Commit

Permalink
Merge pull request #106 from ardielle/httpstatusexc
Browse files Browse the repository at this point in the history
reverse change from #96 to correctly report back http status code/message
  • Loading branch information
havetisyan authored Mar 3, 2019
2 parents 53c17e6 + d8086da commit 7b45da6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rdl/go-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,7 @@ func goMethodBody(reg rdl.TypeRegistry, r *rdl.Resource, precise bool) string {
s += "\t\tvar errobj rdl.ResourceError\n"
s += "\t\tcontentBytes, err " + assign + " ioutil.ReadAll(resp.Body)\n"
s += "\t\tif err != nil {\n\t\t\t" + errorReturn + "\n\t\t}\n"
s += "\t\terr = json.Unmarshal(contentBytes, &errobj)\n"
s += "\t\tif err != nil {\n\t\t\t" + errorReturn + "\n\t\t}\n"
s += "\t\tjson.Unmarshal(contentBytes, &errobj)\n"
s += "\t\tif errobj.Code == 0 {\n"
s += "\t\t\terrobj.Code = resp.StatusCode\n"
s += "\t\t}\n"
Expand Down

0 comments on commit 7b45da6

Please sign in to comment.