Skip to content

Commit 7b45da6

Browse files
authored
Merge pull request #106 from ardielle/httpstatusexc
reverse change from #96 to correctly report back http status code/message
2 parents 53c17e6 + d8086da commit 7b45da6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rdl/go-client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,7 @@ func goMethodBody(reg rdl.TypeRegistry, r *rdl.Resource, precise bool) string {
667667
s += "\t\tvar errobj rdl.ResourceError\n"
668668
s += "\t\tcontentBytes, err " + assign + " ioutil.ReadAll(resp.Body)\n"
669669
s += "\t\tif err != nil {\n\t\t\t" + errorReturn + "\n\t\t}\n"
670-
s += "\t\terr = json.Unmarshal(contentBytes, &errobj)\n"
671-
s += "\t\tif err != nil {\n\t\t\t" + errorReturn + "\n\t\t}\n"
670+
s += "\t\tjson.Unmarshal(contentBytes, &errobj)\n"
672671
s += "\t\tif errobj.Code == 0 {\n"
673672
s += "\t\t\terrobj.Code = resp.StatusCode\n"
674673
s += "\t\t}\n"

0 commit comments

Comments
 (0)