File tree 3 files changed +16
-10
lines changed
3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixed
6
+
7
+ - #27 : ErrorPlugin and sendAsyncRequest() incompatibility
8
+
9
+
3
10
## 1.6 - 2016-09-12
4
11
5
12
### Changed
Original file line number Diff line number Diff line change @@ -93,13 +93,7 @@ public function wait(PromiseCore $targetCore = null)
93
93
}
94
94
95
95
if (CURLE_OK === $ info ['result ' ]) {
96
- try {
97
- $ core ->fulfill ();
98
- } catch (\Exception $ e ) {
99
- $ core ->reject (
100
- new RequestException ($ e ->getMessage (), $ core ->getRequest (), $ e )
101
- );
102
- }
96
+ $ core ->fulfill ();
103
97
} else {
104
98
$ error = curl_error ($ core ->getHandle ());
105
99
$ core ->reject (new RequestException ($ error , $ core ->getRequest ()));
Original file line number Diff line number Diff line change @@ -177,14 +177,19 @@ public function getException()
177
177
178
178
/**
179
179
* Fulfill promise.
180
- *
181
- * @throws \Exception from on fulfill handler.
182
180
*/
183
181
public function fulfill ()
184
182
{
185
183
$ this ->state = Promise::FULFILLED ;
186
184
$ response = $ this ->responseBuilder ->getResponse ();
187
- $ response ->getBody ()->seek (0 );
185
+ try {
186
+ $ response ->getBody ()->seek (0 );
187
+ } catch (\RuntimeException $ e ) {
188
+ $ exception = new Exception \TransferException ($ e ->getMessage (), $ e ->getCode (), $ e );
189
+ $ this ->reject ($ exception );
190
+
191
+ return ;
192
+ }
188
193
189
194
while (count ($ this ->onFulfilled ) > 0 ) {
190
195
$ callback = array_shift ($ this ->onFulfilled );
You can’t perform that action at this time.
0 commit comments