Skip to content

Commit

Permalink
Fix: onError called from executor during async call
Browse files Browse the repository at this point in the history
  • Loading branch information
amsurana authored and paddybyers committed Jul 17, 2019
1 parent b182174 commit 3070a6c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/src/main/java/io/ably/lib/http/Http.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ public <Result> Request<Result> request(Execute<Result> execute) {
public <Result> Request<Result> failedRequest(final AblyException e) {
return new Request(new Execute<Result>() {
@Override
public void execute(HttpScheduler http, Callback<Result> callback) throws AblyException {
throw e;
public void execute(HttpScheduler http, final Callback<Result> callback) throws AblyException {
//throw e;
http.executor.execute(new Runnable() {
@Override
public void run() {
callback.onError(e.errorInfo);
}
});
}
});
}
Expand Down

0 comments on commit 3070a6c

Please sign in to comment.