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

[librariesio] Missing try/catch block and tests #1644

Merged
merged 3 commits into from
Apr 14, 2018
Merged

Conversation

PyvesB
Copy link
Member

@PyvesB PyvesB commented Apr 13, 2018

This pull request should close #1621 by adding our usual try/catch block. There weren't any tests for this service, so I implemented a simple test suite (one extra box ticked in #1358! 👍 ) and also got rid of the var keyword in favour of more appropriate identifiers.

@PyvesB PyvesB added service-badge Accepted and actionable changes, features, and bugs sentry Bugs found using Sentry labels Apr 13, 2018
@shields-ci
Copy link

shields-ci commented Apr 13, 2018

Messages
📖

✨ Thanks for your contribution to Shields, @PyvesB!

Generated by 🚫 dangerJS

Copy link
Member

@platan platan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PyvesB Thanks, this looks great!

server.js Outdated

request(options, function(err, res, json) {

if (err || res.statusCode !== 200) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to improve error handling by using

const checkErrorResponse = function(badgeData, err, res, notFoundMessage = 'not found') {

in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks for reviewing!

Copy link
Member

@RedSparr0w RedSparr0w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good!

@PyvesB PyvesB merged commit ac13fdb into badges:master Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sentry Bugs found using Sentry service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in librariesio
4 participants