mirror of
https://github.com/danog/amp.git
synced 2024-11-27 04:24:42 +01:00
5651240615
Dropped strict-types due to spec requiring weak types in callbacks.
26 lines
571 B
PHP
26 lines
571 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 ?: "Too many promises were rejected");
|
|
|
|
$this->reasons = $reasons;
|
|
}
|
|
|
|
/**
|
|
* @return \Throwable[]
|
|
*/
|
|
public function getReasons(): array {
|
|
return $this->reasons;
|
|
}
|
|
}
|