Merge branch 'dev' into 'master'

Separate handling errors

Closes #16

See merge request !2
This commit is contained in:
Drew Warren 2017-01-17 19:09:40 +00:00
commit 6126222e8f
1 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,11 @@ module.exports.create = function (deps) {
function getTerms(err, res) { function getTerms(err, res) {
var links; var links;
if (err || Math.floor(res.statusCode/100)!==2) { if (err) {
return handleErr(err, 'Registration request failed: ' + err.toString());
}
if (Math.floor(res.statusCode/100)!==2) {
return handleErr(err, 'Registration request failed: ' + res.body.toString('utf8')); return handleErr(err, 'Registration request failed: ' + res.body.toString('utf8'));
} }