1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00
amp/lib/MultiReasonException.php

30 lines
607 B
PHP
Raw Normal View History

2016-05-21 16:44:52 +02:00
<?php
2016-05-24 17:39:19 +02:00
namespace Amp;
2016-05-21 16:44:52 +02: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 19:12:55 +02:00
parent::__construct($message ?: "Too many awaitables were rejected");
2016-05-21 16:44:52 +02:00
$this->reasons = $reasons;
}
/**
* @return \Throwable[]|\Exception[]
*/
public function getReasons()
{
return $this->reasons;
}
}