Skip to content

Getting null as Response in OnCompleted callback #1691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomerz90 opened this issue Jan 21, 2020 · 1 comment
Closed

Getting null as Response in OnCompleted callback #1691

tomerz90 opened this issue Jan 21, 2020 · 1 comment

Comments

@tomerz90
Copy link

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.

@tomerz90 tomerz90 changed the title Getting null as Response Getting null as Response in OnCompleted callback Jan 21, 2020
@slandelle
Copy link
Contributor

No idea what you do exactly without you providing a SSCCE.

Then, please use the community mailing list for such questions, not the bug tracker.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants