communicate fuchsia error states to developers (#24191)

This commit is contained in:
Jonah Williams
2018-11-12 23:46:14 -08:00
committed by GitHub
parent cc6e5b2b7f
commit 2e33d08dae
3 changed files with 67 additions and 6 deletions

View File

@@ -203,6 +203,9 @@ class FuchsiaDevice extends Device {
final RunResult result = await runAsync(<String>[
'ssh', '-F', fuchsiaArtifacts.sshConfig.absolute.path, id, command]);
if (result.exitCode != 0) {
if (result.stderr.contains('/tmp/dart.services: No such file or directory')) {
throwToolExit('No Dart Observatories found. Are you running a debug build?');
}
throwToolExit('Command failed: $command\nstdout: ${result.stdout}\nstderr: ${result.stderr}');
return null;
}

View File

@@ -105,6 +105,10 @@ class FuchsiaArtifacts {
File get sshConfig {
if (_sshConfig == null) {
final String buildDirectory = platform.environment['BUILD_DIR'];
if (buildDirectory == null) {
throwToolExit('BUILD_DIR must be supplied to locate SSH keys. For example:\n'
' export BUILD_DIR=path/to/fuchsia/out/x64\n');
}
_sshConfig = fs.file('$buildDirectory/ssh-keys/ssh_config');
}
return _sshConfig;