1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00
amp/lib/MultiReasonException.php
Aaron Piotrowski 69ec812bc0 Require PHP 7
2016-08-11 14:52:40 -05:00

28 lines
587 B
PHP

<?php
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;
}
}