lib/mincer/server.js
function end(res, code) {
  if (code >= 400) {
    // check res object contains connect/express request and next structure
    if (res.req && res.req.next) {
      var error = new Error(http.STATUS_CODES[code]);
      error.status = code;
      return res.req.next(error);
    }

    // write human-friendly error message
    res.writeHead(code);
    res.end('[' + code + '] ' + http.STATUS_CODES[code]);
    return;
  }

  // just end with no body for 304 responses and such
  res.writeHead(code);
  res.end();
}
function end(res, code) {
  if (code >= 400) {
    // check res object contains connect/express request and next structure
    if (res.req && res.req.next) {
      var error = new Error(http.STATUS_CODES[code]);
      error.status = code;
      return res.req.next(error);
    }

    // write human-friendly error message
    res.writeHead(code);
    res.end('[' + code + '] ' + http.STATUS_CODES[code]);
    return;
  }

  // just end with no body for 304 responses and such
  res.writeHead(code);
  res.end();
}
function end ( res , code ) { if ( code >= 400 ) { // check res object contains connect/express request and next structure if ( res . req && res . req . next ) { var error = new Error ( http . STATUS_CODES [ code ] ) ; error . status = code ; return res . req . next ( error ) ; } // write human-friendly error message res . writeHead ( code ) ; res . end ( '[' + code + '] ' + http . STATUS_CODES [ code ] ) ; return ; } // just end with no body for 304 responses and such res . writeHead ( code ) ; res . end ( ) ; }
Helper to write the code and end response
Helper to write the code and end response