Skip to content

Commit

Permalink
Improve the reported error when a worker crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonAndre authored and muglug committed Feb 18, 2020
1 parent 0e23fab commit eadf2f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Psalm/Internal/Fork/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ public function __construct(
// Serialize this child's produced results and send them to the parent.
$process_done_message = new ForkProcessDoneMessage($results ?: []);
} catch (\Throwable $t) {
// This can happen when developing Psalm from source without running `composer update`, or because of rare bugs in Psalm.
/** @psalm-suppress MixedArgument on Windows, for some reason */
$process_done_message = new ForkProcessErrorMessage($t->getMessage());
$process_done_message = new ForkProcessErrorMessage($t->getMessage() . "\nStack trace in the forked worker:\n" . $t->getTraceAsString());
}

$serialized_message = $task_done_buffer . base64_encode(serialize($process_done_message)) . "\n";
Expand Down

0 comments on commit eadf2f8

Please sign in to comment.