mirror of
https://github.com/danog/parallel.git
synced 2025-01-23 06:21:12 +01:00
34 lines
730 B
PHP
34 lines
730 B
PHP
<?php
|
|
namespace Icicle\Concurrent\Exception;
|
|
|
|
class PanicError extends \Error implements Error
|
|
{
|
|
/**
|
|
* @var string Stack trace of the panic.
|
|
*/
|
|
private $trace;
|
|
|
|
/**
|
|
* Creates a new panic error.
|
|
*
|
|
* @param string $message The panic message.
|
|
* @param int $code The panic code.
|
|
* @param string $trace The panic stack trace.
|
|
*/
|
|
public function __construct($message = '', $code = 0, $trace = '')
|
|
{
|
|
parent::__construct($message, $code);
|
|
$this->trace = $trace;
|
|
}
|
|
|
|
/**
|
|
* Gets the stack trace at the point the panic occurred.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPanicTrace()
|
|
{
|
|
return $this->trace;
|
|
}
|
|
}
|