lib/interfaces/restify.js
function restifyErrorHandler(client, config, err, em) {
  var svc = config.getServiceContext();
  em.setServiceContext(svc.service, svc.version);

  errorHandlerRouter(err, em);

  client.sendError(em);
}
function restifyErrorHandler(client, config, err, em) {
  var svc = config.getServiceContext();
  em.setServiceContext(svc.service, svc.version);

  errorHandlerRouter(err, em);

  client.sendError(em);
}
function restifyErrorHandler ( client , config , err , em ) { var svc = config . getServiceContext ( ) ; em . setServiceContext ( svc . service , svc . version ) ; errorHandlerRouter ( err , em ) ; client . sendError ( em ) ; }
The restifyErrorHandler is responsible for taking the captured error, setting
the serviceContext property on the corresponding ErrorMessage instance,
routing the captured error to the right handler so that it can be correctly
marshaled into the ErrorMessage instance and then attempting to send it to
the Stackdriver API via the given API client instance.
@function restifyErrorHandler
@param {AuthClient} client - the API client
@param {NormalizedConfigurationVariables} config - the application
configuration
@param {Any} err - the error being handled
@param {ErrorMessage} - the error message instance container
@returns {Undefined} - does not return anything
The restifyErrorHandler is responsible for taking the captured error setting the serviceContext property on the corresponding ErrorMessage instance routing the captured error to the right handler so that it can be correctly marshaled into the ErrorMessage instance and then attempting to send it to the Stackdriver API via the given API client instance .