Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Cannot catch some https error #31

Closed
mitaku00 opened this issue Oct 25, 2015 · 5 comments
Closed

Cannot catch some https error #31

mitaku00 opened this issue Oct 25, 2015 · 5 comments

Comments

@mitaku00
Copy link

Recently I'm having troubles unable to catch network errors which looks like node https is throwing.
e.g. getaddrinfo ENOTFOUND, read ECONNRESET

node https has on 'error' handling and I think adding following code will handle network error.

var req = https.request(options, handleResponse);
     req.write(payload);
     req.end();
+    req.on('error', function(e) {
+        onError(e)
+    });
@alexander-daniel
Copy link
Contributor

@twintaka, May I see the code you're trying to run when you run into this?

We catch http request errors for plotly.plot here: https://github.com/plotly/plotly-nodejs/blob/master/index.js#L96

Is this only happening on streaming plots?

@mitaku00
Copy link
Author

@alexander-daniel
I should have write more details.
getImage and getFigure doesn't contains the error handling.
https://github.com/plotly/plotly-nodejs/blob/master/index.js#L221
https://github.com/plotly/plotly-nodejs/blob/master/index.js#L166
Thanks!

@mitaku00
Copy link
Author

I didn't try the streaming plots but the code looks like not handling the error.

@alexander-daniel
Copy link
Contributor

Ah great, thank you! I will make a PR shortly to address these issues, thanks for pointing them out!

@mitaku00
Copy link
Author

Great! looking forward for the changes 👍

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

No branches or pull requests

2 participants