You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/12/23 04:25:06 UTC

svn commit: r1222541 - /incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java

Author: kwright
Date: Fri Dec 23 03:25:06 2011
New Revision: 1222541

URL: http://svn.apache.org/viewvc?rev=1222541&view=rev
Log:
Disable fatal exception if resource bundle is not found - just print the message key instead

Modified:
    incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java

Modified: incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java?rev=1222541&r1=1222540&r2=1222541&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java Fri Dec 23 03:25:06 2011
@@ -107,13 +107,16 @@ public class Messages
     catch (MissingResourceException e)
     {
       // Use English if we don't have a bundle for the current locale
-      Logging.misc.warn("Missing resource bundle '" + bundleName + "' for locale '"+locale.toString()+"'");
-      resources = ResourceBundle.getBundle(bundleName, Locale.US, classLoader);
-    }
-    if (resources == null)
-    {
-      Logging.misc.fatal("No US bundle found!");
-      return messageKey;
+      Logging.misc.warn("Missing resource bundle '" + bundleName + "' for locale '"+locale.toString()+"': "+e.getMessage());
+      try
+      {
+        resources = ResourceBundle.getBundle(bundleName, Locale.US, classLoader);
+      }
+      catch (MissingResourceException e2)
+      {
+        Logging.misc.fatal("No US bundle found either!");
+        return messageKey;
+      }
     }
     
     String message;