Skip to content

Conversation

@gbirke
Copy link
Contributor

@gbirke gbirke commented Feb 9, 2018

Don't crash node RED server on failed HTTP status codes or JSON errors in return body.

Some code cleanup.
Added network tests.

Remove trailing whitespaces
Add semicolons
Use HTTPS.

Check the HTTP status code to avoid trying to parse empty JSON messages.
Catch JSON parsing errors.
@jsf-clabot
Copy link

jsf-clabot commented Feb 9, 2018

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 71.566% when pulling 27ec0cd on gbirke:robust-pinboard into 545fd70 on node-red:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 71.566% when pulling 27ec0cd on gbirke:robust-pinboard into 545fd70 on node-red:master.

@coveralls
Copy link

coveralls commented Feb 9, 2018

Coverage Status

Coverage increased (+0.5%) to 72.269% when pulling e1887a2 on gbirke:robust-pinboard into 545fd70 on node-red:master.

Instead of using timeouts, use sinon.js to stub the error functions.
This also improves code quality as the test code no longer needs to know
the logging internals.
use nock to intercept pinboard network requests.
Change http.get to http.request to play nice with our 4-year old version
of nock.
If the server (or network mock) sends no HTTP status message, improvise.
Show user-friendly, translatable status messages, log raw errors.
@dceejay
Copy link
Member

dceejay commented Feb 15, 2018

looks good - are you done with updating test etc ? OK to merge ?

@gbirke
Copy link
Contributor Author

gbirke commented Feb 15, 2018

I'm done with this improvement, thank your for asking.

@dceejay dceejay merged commit 49b051d into node-red:master Feb 15, 2018
@dceejay
Copy link
Member

dceejay commented Feb 15, 2018

Thanks for this.
(especially for adding the tests :-)

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.

4 participants