syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/6] syncope git commit: Better error management in case of missing workflow definition
Date Fri, 21 Apr 2017 11:04:36 GMT
Better error management in case of missing workflow definition


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

Branch: refs/heads/2_0_X
Commit: 4659fd3d5d3474bfc939a618bbb1f84dc1fe7c3f
Parents: 1bfa4f4
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Apr 21 12:40:41 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Apr 21 12:40:41 2017 +0200

----------------------------------------------------------------------
 .../client/console/resources/AbstractWorkflowResource.java       | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/4659fd3d/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
index 2998644..85a2cbc 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.resources;
 
+import javax.ws.rs.NotFoundException;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.client.console.commons.Constants;
@@ -48,6 +49,9 @@ abstract class AbstractWorkflowResource extends AbstractResource {
                         return modelId.toString().equals(object.getModelId());
                     }
                 });
+        if (workflowDefinition == null) {
+            throw new NotFoundException("Workflow definition with modelId " + modelId);
+        }
 
         return workflowDefinition;
     }


Mime
View raw message