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

Request timeout crashes Hubot #39

Open
skasch opened this issue Jun 13, 2016 · 0 comments
Open

Request timeout crashes Hubot #39

skasch opened this issue Jun 13, 2016 · 0 comments

Comments

@skasch
Copy link

skasch commented Jun 13, 2016

Hello!

I have an issue with Google images search: because of the proxy I'm behind, the request sometimes timeout.

Though the timeout is nothing you can do about, the problem is that whenever the requests timeout, my hubot instance crashes.

The problem is hubot-google-images tries to get the statusCode field of an answer that doesn't contain any; I get the following answer:

{ [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }

I cannot test it easily on my side (because I do not have full control of my development environment), but I think replacing line 84 of hubot-google-images.coffee:

if res.statusCode is 403

by

if not ('statusCode' of res)
  ms.send "Timeout :("
else if res.statusCode is 403

should fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant