Skip to content

Commit

Permalink
TaskListener#onFailure to accept Exception instead of Throwable (#44946)
Browse files Browse the repository at this point in the history
TaskListener accepts today Throwable in its onFailure method. Though
looking at where it is called (TransportAction), it can never be
notified of a Throwable.

This commit changes the signature of TaskListener#onFailure so that it
accepts an `Exception` rather than a `Throwable` as second argument.
  • Loading branch information
javanna authored and jkakavas committed Jul 31, 2019
1 parent da70449 commit c7e4cbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onResponse(Task task, Response response) {
}

@Override
public void onFailure(Task task, Throwable e) {
public void onFailure(Task task, Exception e) {
logger.warn(() -> new ParameterizedMessage("{} failed with exception", task.getId()), e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public interface TaskListener<Response> {
* @param e
* the failure
*/
void onFailure(Task task, Throwable e);
void onFailure(Task task, Exception e);

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static <T> TaskListener<T> nullTaskListener() {
public void onResponse(Task task, T o) {}

@Override
public void onFailure(Task task, Throwable e) {}
public void onFailure(Task task, Exception e) {}
};
}
}

0 comments on commit c7e4cbf

Please sign in to comment.