File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 20
20
use PHPStan \Internal \DirectoryCreator ;
21
21
use PHPStan \Internal \DirectoryCreatorException ;
22
22
use PHPStan \PhpDoc \StubFilesProvider ;
23
+ use PHPStan \Process \ProcessCanceledException ;
24
+ use PHPStan \Process \ProcessCrashedException ;
23
25
use PHPStan \Process \ProcessHelper ;
24
26
use PHPStan \Process \ProcessPromise ;
25
27
use PHPStan \ShouldNotHappenException ;
@@ -479,12 +481,24 @@ private function analyse(
479
481
$ this ->processInProgress = null ;
480
482
$ server ->close ();
481
483
$ output ->writeln ('<error>Worker process exited: ' . $ e ->getMessage () . '</error> ' );
484
+
485
+ if ($ e instanceof ProcessCanceledException) {
486
+ return ;
487
+ }
488
+
489
+ if ($ e instanceof ProcessCrashedException) {
490
+ $ message = 'Analysis crashed ' ;
491
+ $ trace = $ e ->getMessage ();
492
+ } else {
493
+ $ message = $ e ->getMessage ();
494
+ $ trace = $ e ->getTraceAsString ();
495
+ }
482
496
$ phpstanFixerEncoder ->write (['action ' => 'analysisCrash ' , 'data ' => [
483
497
'internalErrors ' => [new InternalError (
484
- $ e -> getMessage () ,
498
+ $ message ,
485
499
'running PHPStan Pro worker ' ,
486
500
InternalError::prepareTrace ($ e ),
487
- $ e -> getTraceAsString () ,
501
+ $ trace ,
488
502
false ,
489
503
)],
490
504
]]);
You can’t perform that action at this time.
0 commit comments