Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log raw graphql responses when they don't unmarshal correctly #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alichay
Copy link

@alichay alichay commented Mar 8, 2023

When the json output doesn't match the struct layout, it prints the raw json response in the error for debugging reasons.

The response pretty-prints and indents the json with a pipe symbol, it looks something like this:

Error: decoding response
 | {
 |     "error": "some error string",
 |     "code": 10,
 | }
error: json: cannot unmarshal object into Go struct field [xyz] of type [jkl]

(it used to be Error: decoding response: json: cannot unmarshal object into Go struct field[xyz] of type [jkl])

Relevant context: superfly/flyctl#1866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant