Fix bad pattern matching in DDS exception parsing (#152685)
Nullable types for values in map patterns require the key to be present. Since the 'uri' key is not always present in DDS exception responses, this was causing us to fall back to throwing a StateError. Fixes https://github.com/flutter/flutter/issues/152684
This commit is contained in:
@@ -125,13 +125,12 @@ class DartDevelopmentServiceException implements Exception {
|
||||
case {
|
||||
'error_code': final int errorCode,
|
||||
'message': final String message,
|
||||
'uri': final String? uri
|
||||
}) {
|
||||
return switch (errorCode) {
|
||||
existingDdsInstanceError =>
|
||||
DartDevelopmentServiceException.existingDdsInstance(
|
||||
message,
|
||||
ddsUri: Uri.parse(uri!),
|
||||
ddsUri: Uri.parse(json['uri']! as String),
|
||||
),
|
||||
failedToStartError => DartDevelopmentServiceException.failedToStart(),
|
||||
connectionError =>
|
||||
|
||||
Reference in New Issue
Block a user