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

Don't crash when server is down #26

Conversation

ruuddotorg
Copy link

Response is undefined when the connection cannot be established, which
caused res.statusCode to blow up with:

/usr/src/app/node_modules/share2nightscout-bridge/index.js:238
        console.log("Error refreshing token", err, res.statusCode, body);
                                                      ^

TypeError: Cannot read property 'statusCode' of undefined

Response is undefined when the connection cannot be established, which
caused res.statusCode to blow up with:
```
/usr/src/app/node_modules/share2nightscout-bridge/index.js:238
        console.log("Error refreshing token", err, res.statusCode, body);
                                                      ^

TypeError: Cannot read property 'statusCode' of undefined
```
@ruuddotorg
Copy link
Author

Verified that it now prints the following message but doesn't crash:

Error refreshing token { [Error: connect ETIMEDOUT 162.254.184.132:443]
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '162.254.184.132',
  port: 443 } undefined undefined

@PieterGit
Copy link
Collaborator

Fixed with #33

@PieterGit PieterGit closed this Jan 2, 2019
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