code: function koaErrorHandler(client, config) {
  
    /**
     * The actual error handler for the Koa plugin attempts to yield the results
     * of downstream request handlers and will attempt to catch errors emitted by
     * these handlers.
     * @param {Function} next - the result of the request handlers to yield
     * @returns {Undefined} does not return anything
     */
    return function * (next) {
      var em;
      var svc = config.getServiceContext();
  
      try {
  
        yield next;
      } catch (err) {
  
        em = new ErrorMessage()
                 .consumeRequestInformation(
                     koaRequestInformationExtractor(this.request, this.response))
                 .setServiceContext(svc.service,
                                    svc.version);
  
        errorHandlerRouter(err, em);
  
        client.sendError(em);
      }
    };
  }
docs: The koaErrorHandler should be placed at the beginning of the koa middleware
  stack and should catch the yield of the output of the request handling chain.
  The Koa error handler returns the actual error handler which will be used in
  the request chain handling and this function corresponds to the format given
  in: https://github.com/koajs/koa/wiki/Error-Handling.
  @function koaErrorHandler
  @param {AuthClient} - The API client instance to report errors to Stackdriver
  @param {NormalizedConfigurationVariables} - The application configuration
  @returns {Function} - The function used to catch errors yielded by downstream
  request handlers.