code: function _sanitizeErr(err, req, res, errmsg) {
      if (err.statusCode === 404 && res && res.headers['content-type'] &&
          res.headers['content-type'].split(';')[0] !== 'application/json')
      {
          err.message = errmsg || 'not found';
      }
      return err;
  }
docs: --- internal support functions 
  Special handling of errors from the registry server.
  
  When some of the endpoints get a 404, the response body is a largish dump
  of test/html. We don't want to include that as an error "message". It
  isn't useful.
  
  Usage:
  cb(new _sanitizeErr(err, req, res[, errmsg]));
  
  where `errmsg` is an optional fallback error message to use for the
  sanitized 404 err.message.