@@ -53,13 +53,13 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
53
53
$ this ->state = self ::FULFILLED ;
54
54
55
55
return $ response ;
56
- }, function ($ reason ) use ( $ request ) {
56
+ }, function ($ reason ) {
57
57
$ this ->state = self ::REJECTED ;
58
58
59
59
if ($ reason instanceof HttplugException) {
60
60
$ this ->exception = $ reason ;
61
61
} elseif ($ reason instanceof GuzzleExceptions \GuzzleException) {
62
- $ this ->exception = $ this ->handleException ($ reason, $ request );
62
+ $ this ->exception = $ this ->handleException ($ reason );
63
63
} elseif ($ reason instanceof \Throwable) {
64
64
$ this ->exception = new HttplugException \TransferException ('Invalid exception returned from Guzzle7 ' , 0 , $ reason );
65
65
} else {
@@ -85,7 +85,7 @@ public function wait($unwrap = true)
85
85
$ this ->promise ->wait (false );
86
86
87
87
if ($ unwrap ) {
88
- if (self ::REJECTED == $ this ->getState ()) {
88
+ if (self ::REJECTED === $ this ->getState ()) {
89
89
throw $ this ->exception ;
90
90
}
91
91
@@ -98,7 +98,7 @@ public function wait($unwrap = true)
98
98
*
99
99
* @return HttplugException
100
100
*/
101
- private function handleException (GuzzleExceptions \GuzzleException $ exception, RequestInterface $ request )
101
+ private function handleException (GuzzleExceptions \GuzzleException $ exception )
102
102
{
103
103
if ($ exception instanceof GuzzleExceptions \ConnectException) {
104
104
return new HttplugException \NetworkException ($ exception ->getMessage (), $ exception ->getRequest (), $ exception );
0 commit comments