mirror of
https://github.com/amphp/parallel.git
synced 2025-01-17 20:58:36 +01:00
Remove unnecessary indirection method
This commit is contained in:
parent
a4b23892a1
commit
0a86594cf3
@ -8,9 +8,4 @@ namespace Amp\Parallel\Context;
|
||||
final class ContextPanicError extends \Error
|
||||
{
|
||||
use Internal\ContextException;
|
||||
|
||||
protected function invokeExceptionConstructor(string $message, ?\Throwable $previous): void
|
||||
{
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ trait ContextException
|
||||
. ' if the Xdebug extension is enabled, set "xdebug.mode" to "debug" to include'
|
||||
. ' the exception stack trace in the context in the exception message';
|
||||
|
||||
$this->invokeExceptionConstructor(\sprintf(
|
||||
parent::__construct(\sprintf(
|
||||
$format,
|
||||
$className,
|
||||
$originalMessage,
|
||||
@ -36,11 +36,9 @@ trait ContextException
|
||||
$originalFile,
|
||||
$originalLine,
|
||||
self::class,
|
||||
), $previous);
|
||||
), previous: $previous);
|
||||
}
|
||||
|
||||
abstract protected function invokeExceptionConstructor(string $message, ?\Throwable $previous): void;
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return \sprintf("%s\nStack trace in context:\n%s", $this->getMessage(), $this->getOriginalTraceAsString());
|
||||
|
@ -7,9 +7,4 @@ use Amp\Parallel\Context\Internal;
|
||||
final class TaskFailureError extends \Error implements TaskFailureThrowable
|
||||
{
|
||||
use Internal\ContextException;
|
||||
|
||||
protected function invokeExceptionConstructor(string $message, ?\Throwable $previous): void
|
||||
{
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,4 @@ use Amp\Parallel\Context\Internal;
|
||||
final class TaskFailureException extends \Exception implements TaskFailureThrowable
|
||||
{
|
||||
use Internal\ContextException;
|
||||
|
||||
protected function invokeExceptionConstructor(string $message, ?\Throwable $previous): void
|
||||
{
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user