diff --git a/lib/register-new-account.js b/lib/register-new-account.js index 7972582..29b32ca 100644 --- a/lib/register-new-account.js +++ b/lib/register-new-account.js @@ -24,7 +24,11 @@ module.exports.create = function (deps) { function getTerms(err, res) { 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')); }