An advanced parallelization library for PHP, enabling efficient multitasking, optimizing resource use, and application responsiveness through multiple CPU threads.
PHP does not call __toString() on a previous exception, so our decision to wrap ContextPanicError in a ContextException had the unfortunate side-effect of removing the context trace from the output of an uncaught exception.
There's a couple ways we can approach this. This PR puts the trace as a string into the message. This has the side-effect of needing to create a stack-trace string for uncaught exceptions from Tasks, but is mostly negligible I'd think.
Another approach would be to use reflection to set the $trace property of the parent exception, forcing the child trace to be the trace of the ContextPanicError object.
(new \ReflectionProperty(parent::class, 'trace'))->setValue($this, $originalTrace);
PHP does not call
__toString()
on a previous exception, so our decision to wrapContextPanicError
in aContextException
had the unfortunate side-effect of removing the context trace from the output of an uncaught exception.There's a couple ways we can approach this. This PR puts the trace as a string into the message. This has the side-effect of needing to create a stack-trace string for uncaught exceptions from
Tasks
, but is mostly negligible I'd think.Another approach would be to use reflection to set the
$trace
property of the parent exception, forcing the child trace to be the trace of theContextPanicError
object.