You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by md...@apache.org on 2018/04/26 13:52:37 UTC

[incubator-openwhisk-client-go] branch master updated: Parse numbers correctly in error response. (#80)

This is an automated email from the ASF dual-hosted git repository.

mdeuser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new e452b52  Parse numbers correctly in error response. (#80)
e452b52 is described below

commit e452b524cd745f71c913c5acccf72a8daba6dc71
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Thu Apr 26 15:52:35 2018 +0200

    Parse numbers correctly in error response. (#80)
---
 whisk/client.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/whisk/client.go b/whisk/client.go
index 85ac505..58a29b7 100644
--- a/whisk/client.go
+++ b/whisk/client.go
@@ -514,8 +514,12 @@ func parseErrorResponse(resp *http.Response, data []byte, v interface{}) (*http.
 	Debug(DbgInfo, "HTTP failure %d + body\n", resp.StatusCode)
 
 	// Determine if an application error was received (#5)
+	buf := bytes.NewBuffer(data)
+	d := json.NewDecoder(buf)
+	d.UseNumber()
+
 	errorResponse := &ErrorResponse{Response: resp}
-	err := json.Unmarshal(data, errorResponse)
+	err := d.Decode(&errorResponse)
 
 	// Determine if error is an application error or an error generated by API
 	if err == nil {

-- 
To stop receiving notification emails like this one, please contact
mdeuser@apache.org.