You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Client.php
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,9 @@ public function doSendRequest(RequestInterface $request)
92
92
*/
93
93
public function addException(\Exception $exception)
94
94
{
95
+
if (!$exception instanceof Exception) {
96
+
@trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($exception).' will not be possible anymore in the future', E_USER_DEPRECATED);
97
+
}
95
98
$this->exceptions[] = $exception;
96
99
}
97
100
@@ -102,6 +105,9 @@ public function addException(\Exception $exception)
102
105
*/
103
106
public function setDefaultException(\Exception $defaultException = null)
104
107
{
108
+
if (!$defaultException instanceof Exception) {
109
+
@trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($defaultException).' will not be possible anymore in the future', E_USER_DEPRECATED);
0 commit comments