You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the server returns an error code with JSON body, and I try to parse it using .json() and {throwHttpErrors: false}, I get the following error:
TypeError: Cannot read property 'request' of undefined
at /path/to/my/project/node_modules/got/dist/source/as-promise/index.js:157:48
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Actual behavior
TypeError is thrown
Expected behavior
Returning the body of response, parsed as JSON (matching the behavior of {responseType: 'json', resolveOnlyBody: true}, as documented)
TypeError: Cannot read property 'request' of undefined
at /path/to/my/project/node_modules/got/dist/source/as-promise/index.js:157:48
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Describe the bug
When the server returns an error code with JSON body, and I try to parse it using
.json()
and{throwHttpErrors: false}
, I get the following error:Actual behavior
TypeError is thrown
Expected behavior
Returning the body of response, parsed as JSON (matching the behavior of
{responseType: 'json', resolveOnlyBody: true}
, as documented)Code to reproduce
https://runkit.com/embed/3tt06wxjbio1
Checklist
The text was updated successfully, but these errors were encountered: