1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Improve the reported error when a worker crashes

This commit is contained in:
Tyson Andre 2020-02-18 14:52:39 -05:00 committed by Matthew Brown
parent 0e23fab5d2
commit eadf2f8492

View File

@ -204,8 +204,9 @@ class Pool
// 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";