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

[GitHub] mdeuser closed pull request #80: Parse numbers correctly in error response.

mdeuser closed pull request #80: Parse numbers correctly in error response.
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/80
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/whisk/client.go b/whisk/client.go
index 85ac505a..58a29b76 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 {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services