2016-05-21 09:44:52 -05:00
|
|
|
<?php
|
|
|
|
|
2016-05-24 10:39:19 -05:00
|
|
|
namespace Amp;
|
2016-05-21 09:44:52 -05:00
|
|
|
|
|
|
|
class MultiReasonException extends \Exception {
|
|
|
|
/**
|
|
|
|
* @var \Throwable[]|\Exception[]
|
|
|
|
*/
|
|
|
|
private $reasons;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \Exception[] $reasons Array of exceptions rejecting the awaitable.
|
|
|
|
* @param string|null $message
|
|
|
|
*/
|
|
|
|
public function __construct(array $reasons, $message = null)
|
|
|
|
{
|
2016-05-21 12:12:55 -05:00
|
|
|
parent::__construct($message ?: "Too many awaitables were rejected");
|
2016-05-21 09:44:52 -05:00
|
|
|
|
|
|
|
$this->reasons = $reasons;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Throwable[]|\Exception[]
|
|
|
|
*/
|
|
|
|
public function getReasons()
|
|
|
|
{
|
|
|
|
return $this->reasons;
|
|
|
|
}
|
|
|
|
}
|