Conecciones de Promociones
This commit is contained in:
22
app/src/Exception/AggregateException.php
Normal file
22
app/src/Exception/AggregateException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Incoviba\Exception;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
class AggregateException extends Exception
|
||||
{
|
||||
public function __construct(array $exceptions, ?Throwable $previous = null)
|
||||
{
|
||||
$code = count($exceptions);
|
||||
$temp_arr = array_reverse($exceptions);
|
||||
$current = array_shift($temp_arr);
|
||||
$current->previous = $previous;
|
||||
foreach ($temp_arr as $exception) {
|
||||
$exception->previous = $current;
|
||||
$current = $exception;
|
||||
}
|
||||
$message = "Aggregate Exception";
|
||||
parent::__construct($message, $code, $current);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user