gonduit icon indicating copy to clipboard operation
gonduit copied to clipboard

Provide the response body with unsucessful responses

Open etcinit opened this issue 8 years ago • 2 comments

This should help with debugging: etcinit/phabulous#27

etcinit avatar Mar 22 '16 01:03 etcinit

Not sure this was a complete fix. For example when running:

client, err := gonduit.Dial("REDACTED", &core.ClientOptions{
  APIToken: "api-REDACTED",
})

Results in the error logged to console:

(*json.UnmarshalTypeError)(0xc8203d0210)(json: cannot unmarshal object into Go value of type []interface {})

This is because the response from phab is not an array:

{"result":{"authentication":["..."],"signatures":["..."],"input":["..."],"output":["..."]},"error_code":null,"error_info":null}

Let me know if you need more info to diagnose. I simply commented out the spew.Dump line as it still functions correctly.

lyoung-uber avatar Jun 08 '16 21:06 lyoung-uber

Yep, looking at the code it seems I accidentally left in the spew.Dump call, which I was probably using for debugging.

etcinit avatar Jun 09 '16 05:06 etcinit