1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00
amp/lib/MultiReasonException.php
2016-08-17 22:25:54 -05:00

26 lines
602 B
PHP

<?php declare(strict_types = 1);
namespace Amp;
class MultiReasonException extends \Exception {
/** @var \Throwable[] */
private $reasons;
/**
* @param \Throwable[] $reasons Array of exceptions rejecting the awaitable.
* @param string|null $message
*/
public function __construct(array $reasons, string $message = null) {
parent::__construct($message ?: "Too many awaitables were rejected");
$this->reasons = $reasons;
}
/**
* @return \Throwable[]
*/
public function getReasons(): array {
return $this->reasons;
}
}