File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1515use SharkMachine \Psr18Shark \Exception \ClientException ;
1616use SharkMachine \Psr18Shark \Exception \CurlException ;
1717use SharkMachine \Psr18Shark \Exception \NoResponseException ;
18+ use SharkMachine \Psr18Shark \Exception \SendRequestException ;
1819use SharkMachine \Psr18Shark \Handler \RequestMutationHandlerCollection ;
1920use SharkMachine \Psr18Shark \Handler \ResponseMutationHandlerCollection ;
2021use SharkMachine \Psr18Shark \Handler \TransferHandlerCollection ;
@@ -60,7 +61,6 @@ public function __construct(
6061 * @return ResponseInterface
6162 *
6263 * @throws ClientExceptionInterface
63- * @throws Throwable
6464 */
6565 public function sendRequest (RequestInterface $ request ): ResponseInterface
6666 {
@@ -81,7 +81,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface
8181 $ handler ->handleException ($ ex );
8282 }
8383 } else {
84- throw $ ex ;
84+ throw new SendRequestException ( $ ex) ;
8585 }
8686 }
8787 if (!isset ($ response )) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace SharkMachine \Psr18Shark \Exception ;
6+
7+ use Exception ;
8+ use Psr \Http \Client \ClientExceptionInterface ;
9+ use Throwable ;
10+
11+ final class SendRequestException extends Exception implements ClientExceptionInterface
12+ {
13+ /**
14+ * @param Throwable $previous
15+ */
16+ public function __construct (Throwable $ previous )
17+ {
18+ parent ::__construct ('Problem with sending request: ' . $ previous ->getPrevious (), 0 , $ previous );
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments