1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 18:17:52 +01:00
parallel/lib/TaskException.php
Aaron Piotrowski da84a772cf Port to Amp
2016-08-18 11:04:48 -05:00

32 lines
727 B
PHP

<?php
namespace Amp\Concurrent;
class TaskException extends \Exception {
/**
* @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(string $message = '', int $code = 0, string $trace = '') {
parent::__construct($message, $code);
$this->trace = $trace;
}
/**
* Gets the stack trace at the point the panic occurred.
*
* @return string
*/
public function getWorkerTrace(): string {
return $this->trace;
}
}