|
@@ -23,14 +23,13 @@ import org.elasticsearch.xpack.core.ml.action.ClearDeploymentCacheAction;
|
|
|
import org.elasticsearch.xpack.core.ml.action.ClearDeploymentCacheAction.Request;
|
|
|
import org.elasticsearch.xpack.core.ml.action.ClearDeploymentCacheAction.Response;
|
|
|
import org.elasticsearch.xpack.core.ml.inference.assignment.TrainedModelAssignment;
|
|
|
+import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
|
|
import org.elasticsearch.xpack.ml.inference.assignment.TrainedModelAssignmentMetadata;
|
|
|
import org.elasticsearch.xpack.ml.inference.deployment.TrainedModelDeploymentTask;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import static org.elasticsearch.ExceptionsHelper.convertToElastic;
|
|
|
-
|
|
|
public class TransportClearDeploymentCacheAction extends TransportTasksAction<TrainedModelDeploymentTask, Request, Response, Response> {
|
|
|
|
|
|
@Inject
|
|
@@ -59,9 +58,9 @@ public class TransportClearDeploymentCacheAction extends TransportTasksAction<Tr
|
|
|
List<FailedNodeException> failedNodeExceptions
|
|
|
) {
|
|
|
if (taskOperationFailures.isEmpty() == false) {
|
|
|
- throw convertToElastic(taskOperationFailures.get(0).getCause());
|
|
|
+ throw ExceptionsHelper.taskOperationFailureToStatusException(taskOperationFailures.get(0));
|
|
|
} else if (failedNodeExceptions.isEmpty() == false) {
|
|
|
- throw convertToElastic(failedNodeExceptions.get(0));
|
|
|
+ throw failedNodeExceptions.get(0);
|
|
|
}
|
|
|
return new Response(true);
|
|
|
}
|