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

Error response body is a still promise #108

Open
FrankMartinezSRC opened this issue Jun 5, 2020 · 2 comments
Open

Error response body is a still promise #108

FrankMartinezSRC opened this issue Jun 5, 2020 · 2 comments

Comments

@FrankMartinezSRC
Copy link

It seems the issue #81, and #91 by extension, is still happening.

Code to reproduce:

const bent = require('bent');

(async () ={
    try {
        await bent('POST', 'json', `https://google.com`)();
    } catch (err) {
        console.error(err);
    }
})();

Outputs:

Promise { pending }
@Templum
Copy link

Templum commented Jun 9, 2020

I can confirm that responseBody is a Pending Promise. However, it is possible to get the body using .json().
But this causes responseBody to show up as Error: body stream is locked when observed via Debugger.

@seanthingee
Copy link

seanthingee commented Jul 19, 2022

Same here, responseBody is a pending promise in the Browser when the statusCode is 400. I'm using 7.3.12.

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

3 participants