Commits

Sam Adams committed 9831a26

Refactored AT ChempoundServer

  • Participants
  • Parent commits f2eacd3

Comments (0)

Files changed (1)

File chempound-webapp/src/main/java/net/chempound/webapp/pingback/PingbackService.java

             throw new PingbackException(PingbackFault.TARGET_URI_INVALID);
         }
 
+        // Update target URI
+        final URI aggregationUri = findAggregation(targetUri);
+        if (alreadyRegistered(sourceUri, aggregationUri)) {
+            throw new PingbackException(PingbackFault.ALREADY_REGISTERED);
+        }
+
         String source = null;
         try {
             source = fetchSource(sourceUri);
             throw new PingbackException(PingbackFault.SOURCE_URI_DOES_NOT_LINK_TO_TARGET);
         }
 
-        // Update target URI
-        final URI aggregationUri = findAggregation(targetUri);
-
-        if (alreadyRegistered(sourceUri, aggregationUri)) {
-            throw new PingbackException(PingbackFault.ALREADY_REGISTERED);
-        }
-
         registerPingback(sourceUri, aggregationUri);
     }