-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
First of all, thanks for this simple and useful piece of code.
I found a little problem.
When rejecting a promise, the object I get in the .error() function is the OnErrorListener object instead of the rejected Object that I sent.
My code (abbreviated) looks like this:
public Promise example() {
Promise p = new Promise();
p.reject("new Error");
return p;
}
example
.then(res -> handleSuccess(res))
.error(res -> handleError(res)) // `res` doesn't equal "new Error".
So I dug into your code and changed the following line
Line 369 in fda2ba4
| handler.post(() -> handleError(onErrorListener)); |
to:
handler.post(() -> handleError(rejectedObject));
And now it works as expected.
Is that what was supposed to be done?
or did I do something that will bite me back later?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels