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:
parent
8653c33838
commit
a3cc32da64
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ public interface TaskListener<Response> {
|
|||
* @param e
|
||||
* the failure
|
||||
*/
|
||||
void onFailure(Task task, Throwable e);
|
||||
void onFailure(Task task, Exception e);
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue