Skip to content

Return original error when the request went wrong. #32

Merged
merged 3 commits into from Sep 13, 2014

3 participants

@aemkei
aemkei commented Oct 31, 2013

Sometimes the request to the Google Maps API does not return a valid JSON response. This happens eg. if the request times out or of the credentials are wrong.

Before you got this message:

[SyntaxError: Unexpected token u]

Now you get some more the original error:

{ [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }
@aemkei aemkei referenced this pull request Nov 4, 2013
Closed

Better Error Handling #16

@moshen
Owner
moshen commented Nov 7, 2013

Thanks. As noted in #16, this should have been added previously.

Possible to add a test?

@aemkei
aemkei commented Nov 7, 2013

Adding a test is hard, because it will only fail, if the connection to the API is down. Only testing against wrong credentials would be an option.

@moshen
Owner
moshen commented Nov 7, 2013

Credentials and/or set a proxy on a port that should never run a proxy?

@aemkei
aemkei commented Nov 8, 2013

Okay, tests were added for wrong credentials and flaky connections.

@fabriziomoscon fabriziomoscon merged commit 267f6da into moshen:master Sep 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.