Skip to content

Commit 2eea7bf

Browse files
committed
fix retry mechanism in cmd method
1 parent 77d7258 commit 2eea7bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/utils.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,13 @@ String cmd(List<String> cmd,
425425
final result = processManager.runSync(cmd, workingDirectory: workingDirectory, runInShell: true);
426426
if(trace) _traceCommand(cmd, workingDirectory: workingDirectory);
427427
if (result.exitCode != 0) {
428-
error = StdoutException(result.stdout, OSError(result.stderr, result.exitCode));
429-
throw error;
428+
throw StdoutException(result.stdout, OSError(result.stderr, result.exitCode));
430429
}
431430
// return stdout
432431
return result.stdout;
433432
} on StdoutException catch (e) {
433+
error = e;
434+
if(!retry) rethrow;
434435
sleep(Duration(seconds: 5));
435436
}
436437
}

0 commit comments

Comments
 (0)