Add printTrace when vscode package.json parsing fails (#45998)
This commit is contained in:
@@ -9,6 +9,7 @@ import '../base/utils.dart';
|
||||
import '../base/version.dart';
|
||||
import '../convert.dart';
|
||||
import '../doctor.dart';
|
||||
import '../globals.dart';
|
||||
|
||||
// Include VS Code insiders (useful for debugging).
|
||||
const bool _includeInsiders = false;
|
||||
@@ -227,7 +228,8 @@ class VsCode {
|
||||
try {
|
||||
final Map<String, dynamic> jsonObject = castStringKeyedMap(json.decode(jsonString));
|
||||
return jsonObject['version'] as String;
|
||||
} on FormatException {
|
||||
} on FormatException catch (err) {
|
||||
printTrace('Error parsing VSCode $packageJsonPath:\n$err');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user