Skip to content

Commit 85d9f0e

Browse files
committed
feat: propagate process failure via STDOUT
1 parent 2bc995b commit 85d9f0e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/internal/proc.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ function proc(string $process, ?LoopInterface $loop = null): PromiseInterface
5353

5454
return new Promise(
5555
function (callable $resolve, callable $reject) use (&$data, $proc) {
56-
$proc->stdout->on(
57-
'error',
58-
function (\Throwable $err) use ($reject) {
59-
$reject($err);
56+
$proc->stderr->on(
57+
'data',
58+
function (string $err) use ($reject) {
59+
$reject(
60+
new \Exception($err)
61+
);
6062
}
6163
);
6264

0 commit comments

Comments
 (0)