dloy avatar dloy committed d23d992

Updates to support collections in fixity context

Comments (0)

Files changed (1)

fixity-src/src/main/java/org/cdlib/mrt/fixity/service/FixityService.java

         ProcessFixityEntry add = ProcessFixityEntry.getProcessFixityEntry("add", entry, connection, logger);
         FixityEntry responseEntry = add.call();
         if (add.getException() != null) {
-            throw new TException(add.getException());
+            throwException(add.getException());
         }
         return responseEntry;
     }
         ProcessFixityEntry queue = ProcessFixityEntry.getProcessFixityEntry("queue", entry, connection, logger);
         FixityEntry responseEntry = queue.call();
         if (queue.getException() != null) {
-            throw new TException(queue.getException());
+            throwException(queue.getException());
         }
         return responseEntry;
     }
         ProcessFixityEntry test = ProcessFixityEntry.getProcessFixityEntry("test", entry, null, logger);
         FixityEntry responseEntry = test.call();
         if (test.getException() != null) {
-            throw new TException(test.getException());
+            throwException(test.getException());
         }
         return responseEntry;
     }
         ProcessFixityEntry update = ProcessFixityEntry.getProcessFixityEntry("update", entry, connection, logger);
         FixityEntry responseEntry = update.call();
         if (update.getException() != null) {
-            throw new TException(update.getException());
+            throwException(update.getException());
         }
         return responseEntry;
     }
         DeleteFixityEntry delete = DeleteFixityEntry.getDeleteFixityEntry(itemKey, connection, logger);
         FixityEntry responseEntry = delete.call();
         if (delete.getException() != null) {
-            throw new TException(delete.getException());
+            throwException(delete.getException());
         }
         return responseEntry;
     }
         DeleteFixityEntry delete = DeleteFixityEntry.getDeleteFixityEntry(url, connection, logger);
         FixityEntry responseEntry = delete.call();
         if (delete.getException() != null) {
-            throw new TException(delete.getException());
+            throwException(delete.getException());
         }
         return responseEntry;
     }
         return value.substring(7);
     }
 
+    protected void throwException(Exception ex)
+        throws TException
+    {
+        if (ex instanceof TException) {
+            throw (TException) ex;
+        }
+        throw new TException(ex);
+    }
+
     public LoggerInf getLogger() {
         return logger;
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.