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

Handle 500 errors that include an error message. #361

Merged
merged 4 commits into from
Feb 11, 2015
Merged

Handle 500 errors that include an error message. #361

merged 4 commits into from
Feb 11, 2015

Conversation

bradvogel
Copy link

Fixes #360

var google = require('../lib/googleapis');
var scope = nock('https://www.googleapis.com')
.post('/urlshortener/v1/url')
.reply(500, { error: {message: 'There was an error!'}});

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

// handle single request errors
// Consider the response an error if it includes the 'error' property or it has a
// 500 status code.
if ((body && body.error) || res.statusCode >= 500) {

This comment was marked as spam.

@ryanseys ryanseys changed the title Handle 500 errors that include an error message. https://github.com/goog... Handle 500 errors that include an error message. Fixes #360 Feb 11, 2015
@ryanseys ryanseys changed the title Handle 500 errors that include an error message. Fixes #360 Handle 500 errors that include an error message. Feb 11, 2015
@bradvogel
Copy link
Author

Updated.

ryanseys added a commit that referenced this pull request Feb 11, 2015
Handle 500 errors that include an error message.
@ryanseys ryanseys merged commit 6ae2435 into googleapis:master Feb 11, 2015
@bradvogel
Copy link
Author

Thanks! When are you planning to push another version?

@ryanseys
Copy link
Contributor

Released.

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.

Not all errors passed through to error message
2 participants