Provide more useful error message if a non-compliant DAP tool (or user) sends bad input to DAP server (#107827)

This commit is contained in:
Danny Tuppeny
2022-07-19 19:48:05 +01:00
committed by GitHub
parent 0d40e3dd54
commit c67d2587d5
7 changed files with 58 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ class FlutterDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArguments
bool enableDds = true,
super.enableAuthCodes,
super.logger,
super.onError,
}) : _enableDds = enableDds,
// Always disable in the DAP layer as it's handled in the spawned
// 'flutter' process.

View File

@@ -28,6 +28,7 @@ class FlutterTestDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArgum
bool enableDds = true,
super.enableAuthCodes,
super.logger,
super.onError,
}) : _enableDds = enableDds,
// Always disable in the DAP layer as it's handled in the spawned
// 'flutter' process.

View File

@@ -30,21 +30,28 @@ class DapServer {
this.enableAuthCodes = true,
bool test = false,
this.logger,
void Function(Object? e)? onError,
}) : channel = ByteStreamServerChannel(input, output, logger) {
adapter = test
? FlutterTestDebugAdapter(channel,
? FlutterTestDebugAdapter(
channel,
fileSystem: fileSystem,
platform: platform,
ipv6: ipv6,
enableDds: enableDds,
enableAuthCodes: enableAuthCodes,
logger: logger)
: FlutterDebugAdapter(channel,
logger: logger,
onError: onError,
)
: FlutterDebugAdapter(
channel,
fileSystem: fileSystem,
platform: platform,
enableDds: enableDds,
enableAuthCodes: enableAuthCodes,
logger: logger);
logger: logger,
onError: onError,
);
}
final ByteStreamServerChannel channel;