Skip to content

Commit d8086da

Browse files
author
Henry Avetisyan
committed
reverse change from #96 to correctly report back http status code/message
1 parent 53c17e6 commit d8086da

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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)