File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ class _DefaultProcessUtils implements ProcessUtils {
277277 _logger.printTrace (runResult.toString ());
278278 if (throwOnError && runResult.exitCode != 0 &&
279279 (allowedFailures == null || ! allowedFailures (runResult.exitCode))) {
280- runResult.throwException ('Process exited abnormally:\n $runResult ' );
280+ runResult.throwException ('Process exited abnormally with exit code ${ runResult . exitCode } :\n $runResult ' );
281281 }
282282 return runResult;
283283 }
@@ -341,7 +341,7 @@ class _DefaultProcessUtils implements ProcessUtils {
341341 _logger.printTrace (runResult.toString ());
342342 if (throwOnError && runResult.exitCode != 0 &&
343343 (allowedFailures == null || ! allowedFailures (exitCode))) {
344- runResult.throwException ('Process exited abnormally:\n $runResult ' );
344+ runResult.throwException ('Process exited abnormally with exit code $ exitCode :\n $runResult ' );
345345 }
346346 return runResult;
347347 }
@@ -407,7 +407,7 @@ class _DefaultProcessUtils implements ProcessUtils {
407407 }
408408
409409 if (failedExitCode && throwOnError) {
410- String message = 'The command failed' ;
410+ String message = 'The command failed with exit code ${ runResult . exitCode } ' ;
411411 if (verboseExceptions) {
412412 message = 'The command failed\n Stdout:\n ${runResult .stdout }\n '
413413 'Stderr:\n ${runResult .stderr }' ;
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ void main() {
3333 exitCode: 1 ,
3434 ));
3535
36- expect (() async => processUtils.run (< String > ['false' ], throwOnError: true ), throwsProcessException ());
36+ expect (
37+ () async => processUtils.run (< String > ['false' ], throwOnError: true ),
38+ throwsProcessException (message: 'Process exited abnormally with exit code 1' ),
39+ );
3740 });
3841 });
3942
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ void main() {
123123 expect (logger.statusText, contains ('Property List error: Unexpected character \x 01 at line 1 / '
124124 'JSON error: JSON text did not start with array or object and option to allow fragments not '
125125 'set. around line 1, column 0.\n ' ));
126- expect (logger.errorText, 'ProcessException: The command failed\n '
126+ expect (logger.errorText, 'ProcessException: The command failed with exit code 1 \n '
127127 ' Command: /usr/bin/plutil -convert xml1 -o - ${file .absolute .path }\n ' );
128128 }, skip: ! platform.isMacOS); // [intended] requires macos tool chain.
129129
@@ -185,7 +185,7 @@ void main() {
185185 expect (logger.statusText, contains ('foo.plist: Property List error: Unexpected character \x 01 '
186186 'at line 1 / JSON error: JSON text did not start with array or object and option to allow '
187187 'fragments not set. around line 1, column 0.\n ' ));
188- expect (logger.errorText, equals ('ProcessException: The command failed\n '
188+ expect (logger.errorText, equals ('ProcessException: The command failed with exit code 1 \n '
189189 ' Command: /usr/bin/plutil -replace CFBundleIdentifier -string dev.flutter.fake foo.plist\n ' ));
190190 }, skip: ! platform.isMacOS); // [intended] requires macos tool chain.
191191
You can’t perform that action at this time.
0 commit comments