From d8086da4de7b0fbeea485947d5cc532b65cd4027 Mon Sep 17 00:00:00 2001 From: Henry Avetisyan Date: Sat, 2 Mar 2019 13:47:37 -0800 Subject: [PATCH] reverse change from #96 to correctly report back http status code/message --- rdl/go-client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rdl/go-client.go b/rdl/go-client.go index 7122b06..685ae20 100644 --- a/rdl/go-client.go +++ b/rdl/go-client.go @@ -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"