@@ -53,13 +53,13 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
5353 $ this ->state = self ::FULFILLED ;
5454
5555 return $ response ;
56- }, function ($ reason ) use ( $ request ) {
56+ }, function ($ reason ) {
5757 $ this ->state = self ::REJECTED ;
5858
5959 if ($ reason instanceof HttplugException) {
6060 $ this ->exception = $ reason ;
6161 } elseif ($ reason instanceof GuzzleExceptions \GuzzleException) {
62- $ this ->exception = $ this ->handleException ($ reason, $ request );
62+ $ this ->exception = $ this ->handleException ($ reason );
6363 } elseif ($ reason instanceof \Throwable) {
6464 $ this ->exception = new HttplugException \TransferException ('Invalid exception returned from Guzzle7 ' , 0 , $ reason );
6565 } else {
@@ -85,7 +85,7 @@ public function wait($unwrap = true)
8585 $ this ->promise ->wait (false );
8686
8787 if ($ unwrap ) {
88- if (self ::REJECTED == $ this ->getState ()) {
88+ if (self ::REJECTED === $ this ->getState ()) {
8989 throw $ this ->exception ;
9090 }
9191
@@ -98,7 +98,7 @@ public function wait($unwrap = true)
9898 *
9999 * @return HttplugException
100100 */
101- private function handleException (GuzzleExceptions \GuzzleException $ exception, RequestInterface $ request )
101+ private function handleException (GuzzleExceptions \GuzzleException $ exception )
102102 {
103103 if ($ exception instanceof GuzzleExceptions \ConnectException) {
104104 return new HttplugException \NetworkException ($ exception ->getMessage (), $ exception ->getRequest (), $ exception );
0 commit comments