forked from firka/flutter
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:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user