1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00
amp/lib/MultiReasonException.php
2018-06-18 20:00:01 +02:00

29 lines
576 B
PHP

<?php
namespace Amp;
class MultiReasonException extends \Exception
{
/** @var \Throwable[] */
private $reasons;
/**
* @param \Throwable[] $reasons Array of exceptions rejecting the promise.
* @param string|null $message
*/
public function __construct(array $reasons, string $message = null)
{
parent::__construct($message ?: "Multiple errors encountered");
$this->reasons = $reasons;
}
/**
* @return \Throwable[]
*/
public function getReasons(): array
{
return $this->reasons;
}
}