File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ function ($value) use ($subject) {
85
85
$ subject ->onCompleted ();
86
86
},
87
87
function ($ error ) use ($ subject ) {
88
- $ error = $ error instanceof \Exception ? $ error : new RejectedPromiseException ($ error );
88
+ $ error = $ error instanceof \Throwable ? $ error : new RejectedPromiseException ($ error );
89
89
$ subject ->onError ($ error );
90
90
}
91
91
);
Original file line number Diff line number Diff line change 3
3
4
4
namespace Rx \Functional \React ;
5
5
6
- use Exception ;
7
6
use React \Promise \Deferred ;
7
+ use React \Promise \Promise as ReactPromise ;
8
8
use Rx \Functional \FunctionalTestCase ;
9
9
use Rx \Observer \CallbackObserver ;
10
10
use Rx \React \Promise ;
@@ -40,7 +40,9 @@ function () {
40
40
*/
41
41
public function from_promise_failure ()
42
42
{
43
- $ p = Promise::rejected (new Exception ('error ' ));
43
+ $ p = new ReactPromise (function () {
44
+ 1 / 0 ;
45
+ });
44
46
45
47
$ source = Promise::toObservable ($ p );
46
48
@@ -49,8 +51,8 @@ function ($x) {
49
51
$ this ->assertFalse (true );
50
52
51
53
},
52
- function ($ error ) {
53
- $ this ->assertEquals ( $ error , new Exception ( ' error ' ));
54
+ function (\ Throwable $ error ) {
55
+ $ this ->assertStringContainsStringIgnoringCase ( ' division by zero ' , $ error-> getMessage ( ));
54
56
},
55
57
function () {
56
58
$ this ->assertFalse (true );
You can’t perform that action at this time.
0 commit comments