Skip to content

Commit 08f557f

Browse files
committed
[Notifier] Allow passing a previous throwable to exceptions
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent fbd8eb3 commit 08f557f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Exception/TransportException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TransportException extends RuntimeException implements TransportExceptionI
2323
private $response;
2424
private $debug = '';
2525

26-
public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null)
26+
public function __construct(string $message, ResponseInterface $response, int $code = 0, \Throwable $previous = null)
2727
{
2828
$this->response = $response;
2929
$this->debug .= $response->getInfo('debug') ?? '';

Exception/UnsupportedSchemeException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class UnsupportedSchemeException extends LogicException
9191
/**
9292
* @param string[] $supported
9393
*/
94-
public function __construct(Dsn $dsn, string $name = null, array $supported = [])
94+
public function __construct(Dsn $dsn, string $name = null, array $supported = [], \Throwable $previous = null)
9595
{
9696
$provider = $dsn->getScheme();
9797
if (false !== $pos = strpos($provider, '+')) {
@@ -109,6 +109,6 @@ public function __construct(Dsn $dsn, string $name = null, array $supported = []
109109
$message .= sprintf('; supported schemes for notifier "%s" are: "%s"', $name, implode('", "', $supported));
110110
}
111111

112-
parent::__construct($message.'.');
112+
parent::__construct($message.'.', 0, $previous);
113113
}
114114
}

0 commit comments

Comments
 (0)