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

add response to err #20

Merged
merged 2 commits into from
Dec 19, 2015
Merged

Conversation

yorkie
Copy link
Contributor

@yorkie yorkie commented Dec 17, 2015

I used the awesome module with react, and it works but just a flaw when I try to use superagent-promise in await/async syntax.

See the below:

async function test () {
  try {
    await promisedAgent.get('/foo').end();
  } catch (e) {
    // here I can't access the response
  }
}

Hence, I propose that exposing response at the e.

/cc @lightsofapollo

@clayreimann
Copy link
Collaborator

Looks awesome, I think this closes #18 too!

Can you add a test for this?

@yorkie
Copy link
Contributor Author

yorkie commented Dec 19, 2015

@clayreimann thanks for the tip, I added test and it got pass in my machine as well :-)

@yorkie
Copy link
Contributor Author

yorkie commented Dec 19, 2015

BTW, we could close #18 as well when this PR gets merged :-)

clayreimann added a commit that referenced this pull request Dec 19, 2015
@clayreimann clayreimann merged commit 5a300ff into lightsofapollo:master Dec 19, 2015
@yorkie yorkie deleted the add/response-to-err branch December 19, 2015 11:24
@yorkie
Copy link
Contributor Author

yorkie commented Dec 19, 2015

Hey @clayreimann did you forget to bump version and publish to NPM?

@clayreimann
Copy link
Collaborator

Yes, yes I did. Just got on a plane but I'll try and get this done later
today.

@yorkie
Copy link
Contributor Author

yorkie commented Dec 19, 2015

Lol, not a hurry, I still can use my personal git link in package.json, just take your time :-)

@clayreimann
Copy link
Collaborator

Pushed just now. Let me know if it doesn't deploy.

@yorkie
Copy link
Contributor Author

yorkie commented Dec 23, 2015

So sweet @clayreimann, 1.1.0 is working for me :-)

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.

2 participants