Refactor flutter command exit code - part 2 (#6817)

* convert pubGet to throw ToolExit on non-zero exit code
* convert commandValidator to throw ToolExit for non-zero exit code
* convert flutter commands to throw ToolExit for non-zero exit code
* use convenience method throwToolExit
* only show "if this problem persists" for unusual exceptions
This commit is contained in:
Dan Rubel
2016-11-13 22:09:03 -05:00
committed by GitHub
parent 90f7afcbcf
commit e384c0d982
28 changed files with 296 additions and 374 deletions

View File

@@ -114,9 +114,11 @@ Future<Null> main(List<String> args) async {
stderr.writeln(chain.terse.toString());
stderr.writeln();
}
stderr.writeln('If this problem persists, please report the problem at');
stderr.writeln('https://github.com/flutter/flutter/issues/new');
_exit(error.exitCode ?? 65);
if (error.isUnusual) {
stderr.writeln('If this problem persists, please report the problem at');
stderr.writeln('https://github.com/flutter/flutter/issues/new');
}
_exit(error.exitCode ?? 1);
} else if (error is ProcessExit) {
// We've caught an exit code.
_exit(error.exitCode);