airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: adding ValidatorException handling to createlaunchexperiment
Date Thu, 22 May 2014 19:17:21 GMT
Repository: airavata
Updated Branches:
  refs/heads/master ce10da776 -> b7ae2349b


adding ValidatorException handling to createlaunchexperiment


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b7ae2349
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b7ae2349
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b7ae2349

Branch: refs/heads/master
Commit: b7ae2349bee29f3e28af6e649ab14104a2e9e823
Parents: ce10da7
Author: lahiru <lahiru@apache.org>
Authored: Thu May 22 15:17:08 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Thu May 22 15:17:08 2014 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java       | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b7ae2349/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index e39430a..d4ad7a3 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -21,7 +21,7 @@
 
 package org.apache.airavata.client.samples;
 
-import org.apache.airavata.model.error.ExperimentNotFoundException;
+import org.apache.airavata.model.error.*;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ClientSettings;
 import org.apache.airavata.model.util.ProjectModelUtil;
@@ -29,15 +29,13 @@ import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.client.AiravataClientFactory;
-import org.apache.airavata.model.error.AiravataClientException;
-import org.apache.airavata.model.error.AiravataSystemException;
-import org.apache.airavata.model.error.InvalidRequestException;
 import org.apache.airavata.client.AiravataAPIFactory;
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.client.tools.DocumentCreator;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.model.util.ExperimentModelUtil;
+import org.apache.airavata.model.workspace.experiment.ValidatorResult;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -446,6 +444,15 @@ public class CreateLaunchExperiment {
         } catch (AiravataClientException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new AiravataClientException(e);
+        } catch (LaunchValidationException e) {
+            logger.error("Validation failed" + e.getErrorMessage());
+            org.apache.airavata.model.error.ValidationResults validationResult = e.getValidationResult();
+            for (org.apache.airavata.model.error.ValidatorResult vResult : validationResult.getValidationResultList())
{
+                if (!vResult.isSetResult()) {
+                    System.out.println("Error:" + vResult.getErrorDetails());
+                }
+            }
+            throw e;
         }catch (TException e) {
             logger.error("Error occured while creating the experiment...", e.getMessage());
             throw new TException(e);


Mime
View raw message