lib/interfaces/hapi.js
function hapiErrorHandler(req, err, config) {
  var service = '';
  var version = '';

  if (isObject(config)) {
    service = config.getServiceContext().service;
    version = config.getServiceContext().version;
  }

  var em = new ErrorMessage()
               .consumeRequestInformation(hapiRequestInformationExtractor(req))
               .setServiceContext(service, version);

  errorHandlerRouter(err, em);

  return em;
}
function hapiErrorHandler(req, err, config) {
  var service = '';
  var version = '';

  if (isObject(config)) {
    service = config.getServiceContext().service;
    version = config.getServiceContext().version;
  }

  var em = new ErrorMessage()
               .consumeRequestInformation(hapiRequestInformationExtractor(req))
               .setServiceContext(service, version);

  errorHandlerRouter(err, em);

  return em;
}
function hapiErrorHandler ( req , err , config ) { var service = '' ; var version = '' ; if ( isObject ( config ) ) { service = config . getServiceContext ( ) . service ; version = config . getServiceContext ( ) . version ; } var em = new ErrorMessage ( ) . consumeRequestInformation ( hapiRequestInformationExtractor ( req ) ) . setServiceContext ( service , version ) ; errorHandlerRouter ( err , em ) ; return em ; }
The Hapi error handler function serves simply to create an error message
and begin that error message on the path of correct population.
@function hapiErrorHandler
@param {Object} req - The Hapi request object
@param {Any} err - The error input
@param {Object} config - the env configuration
@returns {ErrorMessage} - a partially or fully populated instance of
ErrorMessage
The Hapi error handler function serves simply to create an error message and begin that error message on the path of correct population .