forked from reactphp/promise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompositeException.php
More file actions
32 lines (27 loc) · 867 Bytes
/
CompositeException.php
File metadata and controls
32 lines (27 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace React\Promise\Exception;
/**
* Represents an exception that is a composite of one or more other exceptions.
*
* This exception is useful in situations where a promise must be rejected
* with multiple exceptions. It is used for example to reject the returned
* promise from `some()` and `any()` when too many input promises reject.
*/
class CompositeException extends \Exception
{
/** @var \Throwable[] */
private $throwables;
/** @param \Throwable[] $throwables */
public function __construct(array $throwables, string $message = '', int $code = 0, ?\Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->throwables = $throwables;
}
/**
* @return \Throwable[]
*/
public function getThrowables(): array
{
return $this->throwables;
}
}