File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## Unreleased
4+
5+ ### Fixed
6+
7+ - #27 : ErrorPlugin and sendAsyncRequest() incompatibility
8+
9+
310## 1.6 - 2016-09-12
411
512### Changed
Original file line number Diff line number Diff line change @@ -93,13 +93,7 @@ public function wait(PromiseCore $targetCore = null)
9393 }
9494
9595 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 ();
10397 } else {
10498 $ error = curl_error ($ core ->getHandle ());
10599 $ core ->reject (new RequestException ($ error , $ core ->getRequest ()));
Original file line number Diff line number Diff line change @@ -177,14 +177,19 @@ public function getException()
177177
178178 /**
179179 * Fulfill promise.
180- *
181- * @throws \Exception from on fulfill handler.
182180 */
183181 public function fulfill ()
184182 {
185183 $ this ->state = Promise::FULFILLED ;
186184 $ 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+ }
188193
189194 while (count ($ this ->onFulfilled ) > 0 ) {
190195 $ callback = array_shift ($ this ->onFulfilled );
You can’t perform that action at this time.
0 commit comments