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 the response body and the request URI in the Request function #5

Open
borosr opened this issue Apr 15, 2024 · 0 comments
Open

Log the response body and the request URI in the Request function #5

borosr opened this issue Apr 15, 2024 · 0 comments

Comments

@borosr
Copy link
Contributor

borosr commented Apr 15, 2024

Inside the Request function, there is a step where you are trying to unmarshal the request body to JSON. If it fails because the response is a 404 not found error, the json.Unmarshal's error will be something like: json: cannot unmarshal number into Go value of type ... which is not helping the developer to figure out what is the real issue.
Can you add an optional log there inside the error handling to print out the request URI and the raw response body if the error happens?

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

No branches or pull requests

1 participant