lib/errors.js
function buildErrorResponse (
  httpStatusCode,
  errorDetail,
  errorCode,
  errorName,
  errorSource,
  errorMeta
) {
  var out = {
    status: httpStatusCode || statusCodes.INTERNAL_SERVER_ERROR,
    source: errorSource || {},
    title: errorName || '',
    code: errorCode || '',
    detail: errorDetail || ''
  }

  if (errorMeta && typeof errorMeta === 'object') {
    out.meta = errorMeta
  }

  return out
}
function buildErrorResponse (
  httpStatusCode,
  errorDetail,
  errorCode,
  errorName,
  errorSource,
  errorMeta
) {
  var out = {
    status: httpStatusCode || statusCodes.INTERNAL_SERVER_ERROR,
    source: errorSource || {},
    title: errorName || '',
    code: errorCode || '',
    detail: errorDetail || ''
  }

  if (errorMeta && typeof errorMeta === 'object') {
    out.meta = errorMeta
  }

  return out
}
function buildErrorResponse ( httpStatusCode , errorDetail , errorCode , errorName , errorSource , errorMeta ) { var out = { status : httpStatusCode || statusCodes . INTERNAL_SERVER_ERROR , source : errorSource || { } , title : errorName || '' , code : errorCode || '' , detail : errorDetail || '' } if ( errorMeta && typeof errorMeta === 'object' ) { out . meta = errorMeta } return out }
Builds an error object for sending to the user.
@private
@memberOf {Errors}
@param {Number} httpStatusCode specific http status code
@param {String} errorDetail error message for the user, human readable
@param {String} errorCode internal system error code
@param {String} errorName error title for the user, human readable
@param {String} errorSource Some information about the source of the issue
@param {String} errorMeta Some custom meta information to give to the error response
@return {Object}
Builds an error object for sending to the user .