EnoError » snippet

snippet → string

Returns a formatted excerpt of those passage(s) from the input where the error occurred.

javascripttry {
  // ...
} catch(err) {
  if(err instanceof EnoError) {
    err.snippet;
    
    // returns something like ...
    //
    //   Line | Content
    //      1 | 
    // *    2 |     # a
    // *    3 |     ## b
    // >    4 |     ### c < a
    //      5 |
  }
}

Return value

A formatted excerpt of those passage(s) from the input where the error occurred.