docs: function proxyError(err) {
      errState = true;
  
      //
      // Emit an `error` event, allowing the application to use custom
      // error handling. The error handler should end the response.
      //
      if (self.emit('proxyError', err, req, res)) {
        return;
      }
  
      res.writeHead(500, { 'Content-Type': 'text/plain' });
  
      if (req.method !== 'HEAD') {
        //
        // This NODE_ENV=production behavior is mimics Express and
        // Connect.
        //
        if (process.env.NODE_ENV === 'production') {
          res.write('Internal Server Error');
        }
        else {
          res.write('An error has occurred: ' + JSON.stringify(err));
        }
      }
  
      try { res.end() }
      catch (ex) { console.error("res.end error: %s", ex.message) }
    }