incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r591975 - /incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
Date Mon, 05 Nov 2007 12:43:22 GMT
Author: cziegeler
Date: Mon Nov  5 04:43:22 2007
New Revision: 591975

URL: http://svn.apache.org/viewvc?rev=591975&view=rev
Log:
Catch IllegalArgumentException in case a faulty event is stored in the repository.

Modified:
    incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java

Modified: incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java?rev=591975&r1=591974&r2=591975&view=diff
==============================================================================
--- incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
(original)
+++ incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
Mon Nov  5 04:43:22 2007
@@ -317,7 +317,14 @@
             }
         }
         this.addEventProperties(eventNode, properties);
-        return new Event(topic, properties);
+        try {
+            final Event event = new Event(topic, properties);
+            return event;
+        } catch (IllegalArgumentException iae) {
+            // this exception occurs if the topic is not correct (it should never happen,
+            // but you never know)
+            throw new RepositoryException("Unable to read event: " + iae.getMessage(), iae);
+        }
     }
 
     protected void addEventProperties(Node eventNode, Dictionary<String, Object> properties)



Mime
View raw message