1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/vendor/amphp/amp/lib/MultiReasonException.php
2024-07-22 22:18:13 -03:00

29 lines
671 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 ?: "Multiple errors encountered; use "
. self::class . "::getReasons() to retrieve the array of exceptions thrown");
$this->reasons = $reasons;
}
/**
* @return \Throwable[]
*/
public function getReasons(): array
{
return $this->reasons;
}
}