Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 24ec4e0

Browse filesBrowse files
committed
bug #42183 [Notifier] Allow passing a previous throwable to exceptions (derrabus)
This PR was merged into the 5.2 branch. Discussion ---------- [Notifier] Allow passing a previous throwable to exceptions | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A It should always be possible to pass a a previous throwable to a new exception. This PR streamlines the constructors of the Notifier component's exception classes. Commits ------- e197308 [Notifier] Allow passing a previous throwable to exceptions
2 parents b74d9c3 + e197308 commit 24ec4e0
Copy full SHA for 24ec4e0

File tree

2 files changed

+3
-3
lines changed
Filter options

2 files changed

+3
-3
lines changed

‎src/Symfony/Component/Notifier/Exception/TransportException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Exception/TransportException.php
+1-1Lines 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') ?? '';

‎src/Symfony/Component/Notifier/Exception/UnsupportedSchemeException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Exception/UnsupportedSchemeException.php
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.