If we're in the middle of requesting the set of widget previews from the analysis server while the tool shuts down, the request will throw an RPC error:
Thread 0 main threadRpcException: JSON-RPC error -32000: Bad state: The client closed with pending request "Lsp.dart/workspace/getFlutterWidgetPreviews".
at Client.sendRequest (client.dart:134)
at Peer.sendRequest (peer.dart:116)
at DartToolingDaemon.call (dart_tooling_daemon.dart:218)
at WidgetPreviewDtdServices.getFlutterWidgetPreviews (dtd_services.dart:176)
at <asynchronous gap> (async)
at WidgetPreviewStartCommand.runCommand (widget_preview.dart:418)
at <asynchronous gap> (async)
at FlutterCommand.run.<fn> (flutter_command.dart:1630)
at <asynchronous gap> (async)
at AppContext.run.<fn> (context.dart:154)
at <asynchronous gap> (async)
at CommandRunner.runCommand (command_runner.dart:212)
at <asynchronous gap> (async)
at FlutterCommandRunner.runCommand.<fn> (flutter_command_runner.dart:496)
at <asynchronous gap> (async)
at AppContext.run.<fn> (context.dart:154)
at <asynchronous gap> (async)
at FlutterCommandRunner.runCommand (flutter_command_runner.dart:431)
at <asynchronous gap> (async)
at FlutterCommandRunner.run.<fn> (flutter_command_runner.dart:307)
at <asynchronous gap> (async)
at run.<fn>.<fn> (runner.dart:104)
at <asynchronous gap> (async)
at AppContext.run.<fn> (context.dart:154)
at <asynchronous gap> (async)
at main (executable.dart:103)
If we're in the middle of requesting the set of widget previews from the analysis server while the tool shuts down, the request will throw an RPC error: