lib/ejs.js
function rethrow(err, str, flnm, lineno, esc){
  var lines = str.split('\n');
  var start = Math.max(lineno - 3, 0);
  var end = Math.min(lines.length, lineno + 3);
  var filename = esc(flnm); // eslint-disable-line
  // Error context
  var context = lines.slice(start, end).map(function (line, i){
    var curr = i + start + 1;
    return (curr == lineno ? ' >> ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'ejs') + ':'
    + lineno + '\n'
    + context + '\n\n'
    + err.message;

  throw err;
}
function rethrow(err, str, flnm, lineno, esc){
  var lines = str.split('\n');
  var start = Math.max(lineno - 3, 0);
  var end = Math.min(lines.length, lineno + 3);
  var filename = esc(flnm); // eslint-disable-line
  // Error context
  var context = lines.slice(start, end).map(function (line, i){
    var curr = i + start + 1;
    return (curr == lineno ? ' >> ' : '    ')
      + curr
      + '| '
      + line;
  }).join('\n');

  // Alter exception message
  err.path = filename;
  err.message = (filename || 'ejs') + ':'
    + lineno + '\n'
    + context + '\n\n'
    + err.message;

  throw err;
}
function rethrow ( err , str , flnm , lineno , esc ) { var lines = str . split ( '\n' ) ; var start = Math . max ( lineno - 3 , 0 ) ; var end = Math . min ( lines . length , lineno + 3 ) ; var filename = esc ( flnm ) ; // eslint-disable-line // Error context var context = lines . slice ( start , end ) . map ( function ( line , i ) { var curr = i + start + 1 ; return ( curr == lineno ? ' >> ' : '    ' ) + curr + '| ' + line ; } ) . join ( '\n' ) ; // Alter exception message err . path = filename ; err . message = ( filename || 'ejs' ) + ':' + lineno + '\n' + context + '\n\n' + err . message ; throw err ; }
Re-throw the given `err` in context to the `str` of ejs, `filename`, and
`lineno`.

@implements RethrowCallback
@memberof module:ejs-internal
@param {Error}  err      Error object
@param {String} str      EJS source
@param {String} filename file name of the EJS file
@param {String} lineno   line number of the error
@static
Re - throw the given err in context to the str of ejs filename and lineno .