james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joac...@apache.org
Subject svn commit: r481781 - /james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java
Date Sun, 03 Dec 2006 15:49:19 GMT
Author: joachim
Date: Sun Dec  3 07:49:17 2006
New Revision: 481781

URL: http://svn.apache.org/viewvc?view=rev&rev=481781
Log:
catch IllegalStateException when trying to determine the result

Modified:
    james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java

Modified: james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java?view=diff&rev=481781&r1=481780&r2=481781
==============================================================================
--- james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java (original)
+++ james/server/trunk/src/java/org/apache/james/dnsserver/DNSServer.java Sun Dec  3 07:49:17
2006
@@ -337,10 +337,19 @@
             l.setSearchPath(searchPaths);
             Record[] r = l.run();
             
-            if (l.getResult() == Lookup.TRY_AGAIN) {
-                throw new TemporaryResolutionException("DNSServer is temporary not reachable");
-            } else {
-                return r;
+            try {
+                if (l.getResult() == Lookup.TRY_AGAIN) {
+                    throw new TemporaryResolutionException(
+                            "DNSServer is temporary not reachable");
+                } else {
+                    return r;
+                }
+            } catch (IllegalStateException ise) {
+                // This is okay, because it mimics the original behaviour
+                // TODO find out if it's a bug in DNSJava 
+                getLogger().debug("Error determining result ", ise);
+                throw new TemporaryResolutionException(
+                        "DNSServer is temporary not reachable");
             }
             
             // return rawDNSLookup(name, false, type, typeDesc);



---------------------------------------------------------------------
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