Unverified Commit 83b9497c authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

do not exit tool if fuchsia workflow fails (#26589)

parent 800a6e16
...@@ -115,6 +115,9 @@ class FuchsiaDevices extends PollingDeviceDiscovery { ...@@ -115,6 +115,9 @@ class FuchsiaDevices extends PollingDeviceDiscovery {
return <Device>[]; return <Device>[];
} }
final String text = await fuchsiaSdk.listDevices(); final String text = await fuchsiaSdk.listDevices();
if (text == null) {
return <Device>[];
}
final List<FuchsiaDevice> devices = parseListDevices(text); final List<FuchsiaDevice> devices = parseListDevices(text);
return devices; return devices;
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import '../base/common.dart';
import '../base/context.dart'; import '../base/context.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/io.dart'; import '../base/io.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../base/process_manager.dart'; import '../base/process_manager.dart';
import '../globals.dart';
/// The [FuchsiaSdk] instance. /// The [FuchsiaSdk] instance.
FuchsiaSdk get fuchsiaSdk => context[FuchsiaSdk]; FuchsiaSdk get fuchsiaSdk => context[FuchsiaSdk];
...@@ -33,8 +33,8 @@ class FuchsiaSdk { ...@@ -33,8 +33,8 @@ class FuchsiaSdk {
final String path = fuchsiaArtifacts.devFinder.absolute.path; final String path = fuchsiaArtifacts.devFinder.absolute.path;
final RunResult process = await runAsync(<String>[path, 'list', '-full']); final RunResult process = await runAsync(<String>[path, 'list', '-full']);
return process.stdout.trim(); return process.stdout.trim();
} on ArgumentError catch (exception) { } catch (exception) {
throwToolExit('$exception'); printTrace('$exception');
} }
return null; return null;
} }
...@@ -57,8 +57,8 @@ class FuchsiaSdk { ...@@ -57,8 +57,8 @@ class FuchsiaSdk {
controller.addStream(process.stdout.transform(utf8.decoder).transform(const LineSplitter())); controller.addStream(process.stdout.transform(utf8.decoder).transform(const LineSplitter()));
}); });
return controller.stream; return controller.stream;
} on ArgumentError catch (exception) { } catch (exception) {
throwToolExit('$exception'); printTrace('$exception');
} }
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment