Commit 046e0d7a authored by Mohamed Khalil Labidi's avatar Mohamed Khalil Labidi
Browse files

Throw exceptions in scale in in case slf4j does not work

parent 804f0e17
Pipeline #13733 passed with stage
in 1 minute
......@@ -1163,7 +1163,7 @@ public class PAGateway {
Optional<Job> optJob = Optional.ofNullable(EntityManagerHelper.find(Job.class,jobId));
if (!optJob.isPresent()) {
log.error(String.format("Job [%s] not found", jobId));
return 1;
throw new NotFoundException("Job " + jobId + " not found");
}
EntityManagerHelper.refresh(optJob.get());
......@@ -1171,13 +1171,13 @@ public class PAGateway {
Optional<Task> optTask = Optional.ofNullable(optJob.get().findTask(taskName));
if (!optTask.isPresent()) {
log.error(String.format("Task [%s] not found", taskName));
return 1;
throw new NotFoundException("Task " + taskName + " not found");
}
// Validating there will still be at least one deployment in the task
if (optTask.get().getDeployments().size() - nodeNames.size() < 1) {
log.error("I stop the scale-in: the task will loose its last deployment");
return 2;
throw new IllegalArgumentException("Task would loose its last deployment.");
}
// For supplied node, I retrieve their deployment
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment