usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject usergrid git commit: Added case for an error case.
Date Wed, 09 Dec 2015 21:17:50 GMT
Repository: usergrid
Updated Branches:
  refs/heads/unique_index_logging 477335372 -> 78c7235aa


Added case for an error case.


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

Branch: refs/heads/unique_index_logging
Commit: 78c7235aa14507efbb7c4ecf702247d3d06e8c58
Parents: 4773353
Author: George Reyes <grey@apache.org>
Authored: Wed Dec 9 13:17:45 2015 -0800
Committer: George Reyes <grey@apache.org>
Committed: Wed Dec 9 13:17:45 2015 -0800

----------------------------------------------------------------------
 .../usergrid/tools/ManagementUserAudit.java     | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/78c7235a/stack/tools/src/main/java/org/apache/usergrid/tools/ManagementUserAudit.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ManagementUserAudit.java
b/stack/tools/src/main/java/org/apache/usergrid/tools/ManagementUserAudit.java
index 8d4d0b1..4bfe5df 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ManagementUserAudit.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ManagementUserAudit.java
@@ -299,14 +299,19 @@ public class ManagementUserAudit extends ToolBase {
             em.getDictionaryAsMap( orgRef, "orgProperties" );
             OrganizationInfo organizationInfo = managementService.getOrganizationByUuid(
uuid );
 
-            Object[] loggingObject = new Object[3];
-            loggingObject[0] = uniqueValue;
-            loggingObject[1] = organizationInfo.getName();
-            loggingObject[2] = organizationInfo.getUuid();
-            //OrganizationInfo orgInfo = new OrganizationInfo(orgProperties.getProperties()
);
-
-            logger.info( "The following email works: {} with the following orgname: {} and
orgUUID: {}",
-                    loggingObject );
+            if(organizationInfo == null) {
+                logger.error( "The following email works: {} but the orgUUID: {} returns
null.",uniqueValue,uuid );
+            }
+            else {
+
+                Object[] loggingObject = new Object[3];
+                loggingObject[0] = uniqueValue;
+                loggingObject[1] = organizationInfo.getName();
+                loggingObject[2] = organizationInfo.getUuid();
+
+                logger.info( "The following email works: {} with the following orgname: {}
and orgUUID: {}",
+                        loggingObject );
+            }
         }
         catch ( EntityNotFoundException enfe ) {
             logger.error( s2, uniqueValue, uuid );


Mime
View raw message