TaskListener#onFailure to accept Exception instead of Throwable (#44946)

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.
This commit is contained in:
Luca Cavanna 2019-07-29 16:25:39 +02:00
parent 8653c33838
commit a3cc32da64
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ public final class LoggingTaskListener<Response> implements TaskListener<Respons
}
@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);
}
}

View File

@ -44,6 +44,6 @@ public interface TaskListener<Response> {
* @param e
* the failure
*/
void onFailure(Task task, Throwable e);
void onFailure(Task task, Exception e);
}

View File

@ -79,7 +79,7 @@ public class RestDeleteJobAction extends BaseRestHandler {
public void onResponse(Task task, T o) {}
@Override
public void onFailure(Task task, Throwable e) {}
public void onFailure(Task task, Exception e) {}
};
}
}