recentCapturedExceptions function

List<Map<String, dynamic>> recentCapturedExceptions({
  1. int limit = 20,
})

Returns the most recently captured non-fatal errors, newest-first, up to limit entries.

Used by ext.dusk.exceptions (Step 5) to surface non-fatal FlutterErrors even when telescope is absent. Returns defensive copies so callers cannot mutate the buffer.

Implementation

List<Map<String, dynamic>> recentCapturedExceptions({int limit = 20}) {
  final int count = limit < _buffer.length ? limit : _buffer.length;
  return List<Map<String, dynamic>>.generate(
    count < 0 ? 0 : count,
    (int index) => Map<String, dynamic>.of(_buffer[index]),
  );
}