capture method

Future<ReportEvent> capture(
  1. BaseException exception, {
  2. Map<String, dynamic> additionalContext = const {},
  3. bool manual = false,
  4. bool handled = true,
})

Convenience method to capture and report an exception directly.

Throws StateError when the client is not initialized and propagates pipeline/outbox failures; use captureSafely when reporting must not affect the surrounding flow.

Implementation

Future<ReportEvent> capture(
  BaseException exception, {
  Map<String, dynamic> additionalContext = const {},
  bool manual = false,
  bool handled = true,
}) async {
  final event = await createEvent(
    exception,
    additionalContext: additionalContext,
    manual: manual,
    handled: handled,
  );
  await report(event);
  return event;
}