code: function (error, response) {
          if (!_.isNull(error)) {
              error = _.createError(error);
          } else if (!_.isNull(response) && (response.status >= 400 || response.status === 0)) {
              error = _.createError(null, response);
              response = null;
          }
          callback(error, response);
      }
docs: Treat any >=400 status codes as errors.  Also treat the status code 0 as an error (which indicates a connection failure).