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 12
12
use Aternos \Taskmaster \Communication \Socket \Exception \SocketWriteException ;
13
13
use Aternos \Taskmaster \Communication \Socket \SelectableSocketInterface ;
14
14
use Aternos \Taskmaster \Communication \Socket \SocketCommunicatorTrait ;
15
+ use Aternos \Taskmaster \Communication \StdStreams ;
15
16
use Aternos \Taskmaster \Runtime \AsyncRuntimeInterface ;
16
17
use Aternos \Taskmaster \Taskmaster ;
17
18
use Aternos \Taskmaster \Worker \Instance \ProxyableWorkerInstanceInterface ;
@@ -244,7 +245,7 @@ protected function handleFail(null|string|Exception $reason = null): static
244
245
if ($ reason instanceof Exception) {
245
246
$ reason = $ reason ->getMessage ();
246
247
}
247
- fwrite (STDERR , "Proxy runtime failed: " . $ reason . PHP_EOL );
248
+ fwrite (StdStreams:: getInstance ()-> getStderr () , "Proxy runtime failed: " . $ reason . PHP_EOL );
248
249
exit (1 );
249
250
}
250
- }
251
+ }
Original file line number Diff line number Diff line change 8
8
use Aternos \Taskmaster \Communication \Socket \Socket ;
9
9
use Aternos \Taskmaster \Communication \Socket \SocketCommunicatorTrait ;
10
10
use Aternos \Taskmaster \Communication \Socket \SocketInterface ;
11
+ use Aternos \Taskmaster \Communication \StdStreams ;
11
12
use Aternos \Taskmaster \Exception \PhpError ;
12
13
use Aternos \Taskmaster \Exception \PhpFatalErrorException ;
13
14
use Aternos \Taskmaster \Taskmaster ;
@@ -102,7 +103,7 @@ protected function handleFail(null|string|Exception $reason = null): static
102
103
if ($ reason instanceof Exception) {
103
104
$ reason = $ reason ->getMessage ();
104
105
}
105
- fwrite (STDERR , "Runtime failed: " . $ reason . PHP_EOL );
106
+ fwrite (StdStreams:: getInstance ()-> getStderr () , "Runtime failed: " . $ reason . PHP_EOL );
106
107
exit (1 );
107
108
}
108
- }
109
+ }
Original file line number Diff line number Diff line change 6
6
use Aternos \Taskmaster \Communication \Promise \TaskPromise ;
7
7
use Aternos \Taskmaster \Communication \Request \ExecuteFunctionRequest ;
8
8
use Aternos \Taskmaster \Communication \ResponseInterface ;
9
+ use Aternos \Taskmaster \Communication \StdStreams ;
9
10
use Aternos \Taskmaster \Exception \PhpError ;
10
11
use Aternos \Taskmaster \Runtime \RuntimeInterface ;
11
12
use Closure ;
@@ -175,7 +176,7 @@ public function handleResult(mixed $result): void
175
176
public function handleError (Exception $ error ): void
176
177
{
177
178
$ this ->error = $ error ;
178
- fwrite (STDERR , $ error ->getMessage () . PHP_EOL );
179
+ fwrite (StdStreams:: getInstance ()-> getStderr () , $ error ->getMessage () . PHP_EOL );
179
180
}
180
181
181
182
/**
@@ -287,4 +288,4 @@ protected function isSync(): bool
287
288
{
288
289
return $ this ->sync ;
289
290
}
290
- }
291
+ }
You can’t perform that action at this time.
0 commit comments