throw new ServiceErrorsException(errors);
}
}
private static ServiceErrorRestRep taskToError(TaskResourceRep task) {
ServiceErrorRestRep serviceError = task.getServiceError();
if (task.getState() == null) {
serviceError = new ServiceErrorRestRep();
serviceError.setCodeDescription("Task state is null. Unable to determine success of task");
serviceError.setDetailedMessage("");
}
else if (serviceError == null) {
serviceError = new ServiceErrorRestRep();
serviceError.setCodeDescription(task.getMessage() == null ? "No Message" : task.getMessage());
serviceError.setDetailedMessage("");
}
return serviceError;
}