code: function (req, res, err) {
      if (isResHeaderSent(res)) { //request has already been closed
          //console.log('cannot throw error on an already closed request')
          return;
      }
      if (typeof (err.stack) == 'string') {
          err.stack = err.stack.split(' at '); //stack string to array
      }
      var isHtml = new reqres(res, req).isHtml();
      if (isHtml) {
          ack.router().htmlCloseError({ debug: isProductionMode })(err, req, res);
      }
      else {
          ack.router().jsonCloseError({ debug: isProductionMode })(err, req, res);
      }
      resMarkClosed(res);
  }
docs: Handles sending errors back to client including approperiate error details.
  - response status always 500 unless (err.status || err.statusCode)