errorCatcher static method

dynamic errorCatcher(
  1. dynamic e,
  2. StackTrace s
)
catch (e, s){
  Mixins.errorCatcher(e, s);
}

Implementation

static errorCatcher(e, StackTrace s) {
  List frames = Trace.current().frames,
      terseFrames = Trace.from(s).terse.frames;
  Frame frame = Trace.current().frames[frames.length > 1 ? 1 : 0],
      trace = Trace.from(s).terse.frames[terseFrames.length > 1 ? 1 : 0];

  String errorLocation = '${frame.member}', errorLine = '${trace.line}';
  logg('-- Error on $errorLocation (Line $errorLine), $e');
}