Trace.parseFriendly constructor

Trace.parseFriendly(
  1. String trace
)

Parses this package's string representation of a stack trace.

This also parses string representations of Chains. They parse to the same trace that Chain.toTrace would return.

Implementation

Trace.parseFriendly(String trace)
    : this(
          trace.isEmpty
              ? []
              : trace
                  .trim()
                  .split('\n')
                  // Filter out asynchronous gaps from [Chain]s.
                  .where((line) => !line.startsWith('====='))
                  .map(Frame.parseFriendly),
          original: trace);