1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 14:01:14 +01:00
parallel/lib/TaskException.php

32 lines
752 B
PHP
Raw Normal View History

2016-08-21 23:40:48 -05:00
<?php declare(strict_types = 1);
2015-08-27 09:10:08 -05:00
2016-08-23 16:47:40 -05:00
namespace Amp\Parallel;
2016-08-18 11:04:48 -05:00
class TaskException extends \Exception {
2015-08-27 09:10:08 -05: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-08-18 11:04:48 -05:00
public function __construct(string $message = '', int $code = 0, string $trace = '') {
2015-08-27 09:10:08 -05:00
parent::__construct($message, $code);
$this->trace = $trace;
}
/**
* Gets the stack trace at the point the panic occurred.
*
* @return string
*/
2016-08-18 11:04:48 -05:00
public function getWorkerTrace(): string {
2015-08-27 09:10:08 -05:00
return $this->trace;
}
}