1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 12:54:55 +01:00
parallel/lib/Exception/TaskException.php

34 lines
768 B
PHP
Raw Normal View History

2015-08-27 16:10:08 +02:00
<?php
namespace Icicle\Concurrent\Exception;
2015-12-06 07:40:48 +01:00
class TaskException extends \Exception implements Exception
2015-08-27 16:10:08 +02:00
{
/**
* @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.
*/
2016-01-23 07:00:56 +01:00
public function __construct(string $message = '', int $code = 0, string $trace = '')
2015-08-27 16:10:08 +02:00
{
parent::__construct($message, $code);
$this->trace = $trace;
}
/**
* Gets the stack trace at the point the panic occurred.
*
* @return string
*/
2016-01-23 07:00:56 +01:00
public function getWorkerTrace(): string
2015-08-27 16:10:08 +02:00
{
return $this->trace;
}
}