lib/interfaces/restify.js
function restifyRequestFinishHandler(client, config, req, res) {
  var em;

  if (res._body instanceof Error ||
      res.statusCode > 309 && res.statusCode < 512) {
    em = new ErrorMessage().consumeRequestInformation(
        expressRequestInformationExtractor(req, res));

    restifyErrorHandler(client, config, res._body, em);
  }
}
function restifyRequestFinishHandler(client, config, req, res) {
  var em;

  if (res._body instanceof Error ||
      res.statusCode > 309 && res.statusCode < 512) {
    em = new ErrorMessage().consumeRequestInformation(
        expressRequestInformationExtractor(req, res));

    restifyErrorHandler(client, config, res._body, em);
  }
}
function restifyRequestFinishHandler ( client , config , req , res ) { var em ; if ( res . _body instanceof Error || res . statusCode > 309 && res . statusCode < 512 ) { em = new ErrorMessage ( ) . consumeRequestInformation ( expressRequestInformationExtractor ( req , res ) ) ; restifyErrorHandler ( client , config , res . _body , em ) ; } }
The restifyRequestFinishHandler will be called once the response has emitted
the `finish` event and is now in its finalized state. This function will
attempt to determine whether or not the body of response is an instance of
the Error class or its status codes indicate that the response ended in an
error state. If either of the preceding are true then the restifyErrorHandler
will be called with the error to be routed to the Stackdriver service.
@function restifyRequestFinishHandler
@param {AuthClient} client - the API client
@param {NormalizedConfigurationVariables} config - the application
configuration
@param {Object} req - the restify request
@param {Object} res - the restify response
@returns {Undefined} - does not return anything
The restifyRequestFinishHandler will be called once the response has emitted the finish event and is now in its finalized state . This function will attempt to determine whether or not the body of response is an instance of the Error class or its status codes indicate that the response ended in an error state . If either of the preceding are true then the restifyErrorHandler will be called with the error to be routed to the Stackdriver service .