setExceptionBreakpointsRequest method

  1. @override
Future<void> setExceptionBreakpointsRequest(
  1. Request request,
  2. SetExceptionBreakpointsArguments args,
  3. void sendResponse(
    1. SetExceptionBreakpointsResponseBody
    )
)

Handles a request from the client to set exception pause modes.

This method can be called at any time (before the app is launched or while the app is running).

The VM requires exception modes to be set per-isolate so these will be passed to isolateManager that will fan them out to each isolate.

When new isolates are registered, it is isolateManager's responsibility to ensure the pause mode is given to them (and like at startup, this must happen before they are resumed).

Implementation

@override
Future<void> setExceptionBreakpointsRequest(
  Request request,
  SetExceptionBreakpointsArguments args,
  void Function(SetExceptionBreakpointsResponseBody) sendResponse,
) async {
  final mode = args.filters.contains('All')
      ? 'All'
      : args.filters.contains('Unhandled')
          ? 'Unhandled'
          : 'None';

  await isolateManager.setExceptionPauseMode(mode);

  sendResponse(SetExceptionBreakpointsResponseBody());
}