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

Document stream.options #1405

Closed
1 task done
Tracked by #1684
electerious opened this issue Aug 14, 2020 · 6 comments · Fixed by #1699
Closed
1 task done
Tracked by #1684

Document stream.options #1405

electerious opened this issue Aug 14, 2020 · 6 comments · Fixed by #1699
Labels
documentation The issue will improve the docs good for beginner This issue is easy to fix ✭ help wanted ✭

Comments

@electerious
Copy link

What would you like to discuss?

I would like to log the request body/json when an error occurs because it makes it easy to reproduce the failed request. I know that I can log the response body with err.response.body, but can't find a way to do so with the request body.

How can I log the body of the request?

Checklist

  • I have read the documentation.
@szmarczak
Copy link
Collaborator

Can you try error.request.options.body?

@electerious
Copy link
Author

error.request.options.body is undefined

@szmarczak
Copy link
Collaborator

Then you must've done something wrong. https://runkit.com/szmarczak/5f2c9b65c39ec50014a13e48

@szmarczak szmarczak reopened this Aug 17, 2020
@szmarczak
Copy link
Collaborator

Actually we need to document error.request because it's undocumented.

@szmarczak szmarczak added documentation The issue will improve the docs good for beginner This issue is easy to fix ✭ help wanted ✭ and removed documentation The issue will improve the docs good for beginner This issue is easy to fix ✭ help wanted ✭ labels Aug 17, 2020
@szmarczak
Copy link
Collaborator

Actually it's documented. But stream.options is not documented...

@szmarczak szmarczak added documentation The issue will improve the docs good for beginner This issue is easy to fix ✭ help wanted ✭ labels Aug 17, 2020
@electerious
Copy link
Author

This issue was that I've provided the data via json and therefore need to use error.options.json.

@szmarczak szmarczak changed the title Log request body Document stream.options Aug 18, 2020
@szmarczak szmarczak mentioned this issue Mar 21, 2021
71 tasks
@szmarczak szmarczak mentioned this issue Apr 11, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue will improve the docs good for beginner This issue is easy to fix ✭ help wanted ✭
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants