@@ -216,7 +216,18 @@ function ($code, $message, $file, $line) {
216
216
$ header ,
217
217
$ e
218
218
);
219
- $ errors = $ this ->handler ->completeLaunchUnsuccessfully ($ launchId , $ message );
219
+ try {
220
+ $ errors = $ this ->handler ->completeLaunchUnsuccessfully ($ launchId , $ message );
221
+ } catch (Throwable $ e ) {
222
+ $ message = Formatter::exception (
223
+ $ this ->config ->getLogExceptionFormat (),
224
+ $ this ->config ->getMaxExceptionMsgLength (),
225
+ $ header ,
226
+ $ e
227
+ );
228
+ $ errors = $ this ->handler ->completeLaunchUnsuccessfully ($ launchId , $ message );
229
+ }
230
+
220
231
if ($ errors < $ this ->tries ) {
221
232
$ this ->logDebug ($ message );
222
233
sleep ($ this ->tryDelay );
@@ -551,7 +562,9 @@ private function phpErrorHandler($code, $message, $file, $line): void
551
562
if (array_key_exists ($ code , PhpErrors::FATAL )) {
552
563
$ errName = PhpErrors::FATAL [$ code ];
553
564
throw new Exception ("(ATTENTION: PHP $ errName) - $ message " , $ code );
554
- } elseif ($ this ->config ->getLogUncaughtErrors ()) {
565
+ }
566
+
567
+ if ($ this ->config ->getLogUncaughtErrors ()) {
555
568
$ message = (PhpErrors::SOFT [$ code ] ?? 0 ) . " - $ message (code $ code, file $ file, line $ line) " ;
556
569
$ this ->config ->getLogWarningsToError () ?
557
570
$ this ->logError ($ message ) :
0 commit comments