james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r410892 - /james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java
Date Thu, 01 Jun 2006 17:18:17 GMT
Author: norman
Date: Thu Jun  1 10:18:16 2006
New Revision: 410892

URL: http://svn.apache.org/viewvc?rev=410892&view=rev
Log:
Catch NumberParseException and throw new Exception with better log informations

Modified:
    james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java

Modified: james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java?rev=410892&r1=410891&r2=410892&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java (original)
+++ james/server/trunk/src/java/org/apache/james/transport/matchers/RelayLimit.java Thu Jun
 1 10:18:16 2006
@@ -22,6 +22,7 @@
 import org.apache.mailet.Mail;
 
 import javax.mail.Header;
+import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -34,8 +35,12 @@
 public class RelayLimit extends GenericMatcher {
     int limit = 30;
 
-    public void init() {
-        limit = Integer.parseInt(getCondition());
+    public void init() throws MessagingException {
+        try {
+            limit = Integer.parseInt(getCondition());
+        } catch (NumberFormatException e) {
+            throw new MessagingException("No valid integer: " + getCondition());
+        }
     }
 
     public Collection match(Mail mail) throws javax.mail.MessagingException {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message