Fail with better error message in microbenchmarks (#16676)

This commit is contained in:
Todd Volkert
2018-04-17 14:34:09 -07:00
committed by GitHub
parent e9177ba3d1
commit ec26a7baca

View File

@@ -127,7 +127,12 @@ Future<Map<String, double>> _readJsonResults(Process process) {
jsonStarted = false;
processWasKilledIntentionally = true;
process.kill(ProcessSignal.SIGINT); // flutter run doesn't quit automatically
completer.complete(json.decode(jsonBuf.toString()));
final String jsonOutput = jsonBuf.toString();
try {
completer.complete(json.decode(jsonOutput));
} catch (ex) {
completer.completeError('Decoding JSON failed ($ex). JSON string was: $jsonOutput');
}
return;
}