Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=27988
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 2 Mar 2011 13:23:37 +0000 (13:23 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 2 Mar 2011 13:23:37 +0000 (13:23 +0000)
Improve reporting of missing files

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1076212 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/naming/resources/DirContextURLConnection.java
webapps/docs/changelog.xml

index 76278f8..89e54fe 100644 (file)
@@ -342,7 +342,8 @@ public class DirContextURLConnection
         if (object != null)
             return object;
         
-        throw new FileNotFoundException();
+        throw new FileNotFoundException(
+                getURL() == null ? "null" : getURL().toString());
         
     }
     
@@ -378,7 +379,8 @@ public class DirContextURLConnection
             connect();
         
         if (resource == null) {
-            throw new FileNotFoundException();
+            throw new FileNotFoundException(
+                    getURL() == null ? "null" : getURL().toString());
         }
 
         // Reopen resource
@@ -418,7 +420,8 @@ public class DirContextURLConnection
         }
         
         if ((resource == null) && (collection == null)) {
-            throw new FileNotFoundException();
+            throw new FileNotFoundException(
+                    getURL() == null ? "null" : getURL().toString());
         }
         
         Vector<String> result = new Vector<String>();
@@ -446,7 +449,8 @@ public class DirContextURLConnection
                 }
             } catch (NamingException e) {
                 // Unexpected exception
-                throw new FileNotFoundException();
+                throw new FileNotFoundException(
+                        getURL() == null ? "null" : getURL().toString());
             }
         }
         
index f88862b..7e52d4b 100644 (file)
@@ -46,6 +46,9 @@
   <subsection name="Catalina">
     <changelog>
       <fix>
+        <bug>27988</bug>: Improve reporting of missing files. (markt)
+      </fix>
+      <fix>
         <bug>28852</bug>: Add URL encoding where missing to parameters in URLs
         presented by Ant tasks to the Manager application. Based on a patch by
         Stephane Bailliez. (mark)