You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a handler that extends AsyncCompletionHandler, I tried following the code but got lost.
Im downloading a number of files and creating one handler per file.
I have also added a re-try mechanism that downloads this file again with the same handler:
@Override
public State onStatusReceived(HttpResponseStatus status) throws Exception {
if (!HttpStatusCodes.isSuccess(status.getStatusCode())) {
retryOrFail(new FailedToDownloadException(status));
return State.ABORT;
}
return super.onStatusReceived(status);
}
@Override
public void onThrowable(Throwable t) {
retryOrFail(t);
}
retryOrFail create a new get request and calls execute with the handler used for the download that failed.
Im guessing Im just not supposed to re-use handlers for some reason, but would love to get your input about what exactly is going wrong.
The text was updated successfully, but these errors were encountered:
tomerz90
changed the title
Getting null as Response
Getting null as Response in OnCompleted callback
Jan 21, 2020
I created a handler that extends
AsyncCompletionHandler
, I tried following the code but got lost.Im downloading a number of files and creating one handler per file.
I have also added a re-try mechanism that downloads this file again with the same handler:
retryOrFail
create a new get request and callsexecute
with the handler used for the download that failed.Im guessing Im just not supposed to re-use handlers for some reason, but would love to get your input about what exactly is going wrong.
The text was updated successfully, but these errors were encountered: