Author: rahul
Date: Mon Nov  6 22:25:12 2006
New Revision: 472002

URL: http://svn.apache.org/viewvc?view=rev&rev=472002
Log:
Slightly better error reporting when resource key cannot be resolved. Log and 
rethrow exception as MissingResourceException (contains problem key in 
message), rather than ignoring it (which induces a harder to debug NPE down the 
road). Fallout of SHALE-325.

Modified:
    
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java
    
shale/framework/trunk/shale-validator/src/main/resources/org/apache/shale/validator/resources/Bundle.properties

Modified: 
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java?view=diff&rev=472002&r1=472001&r2=472002
==============================================================================
--- 
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java
 (original)
+++ 
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java
 Mon Nov  6 22:25:12 2006
@@ -956,7 +956,9 @@
                try {
                   msg = bundle.getString(msgkey);
                } catch (MissingResourceException ex) {
-                   ; // Ignore this
+                   log.error(messages.getMessage("commonsValidator.msgerror",
+                       new Object[] {msgkey}), ex);
+                   throw ex;
                }
             }
          }

Modified: 
shale/framework/trunk/shale-validator/src/main/resources/org/apache/shale/validator/resources/Bundle.properties
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/resources/org/apache/shale/validator/resources/Bundle.properties?view=diff&rev=472002&r1=472001&r2=472002
==============================================================================
--- 
shale/framework/trunk/shale-validator/src/main/resources/org/apache/shale/validator/resources/Bundle.properties
 (original)
+++ 
shale/framework/trunk/shale-validator/src/main/resources/org/apache/shale/validator/resources/Bundle.properties
 Mon Nov  6 22:25:12 2006
@@ -22,3 +22,4 @@
 commonsValidator.loadresource=Loading validation rules file from {0}
 commonsValidator.skipresource=Skipping validation rules file from "{0}".  No 
url could be located.
 commonsValidator.loaderror=Can't initialize resources
+commonsValidator.msgerror=Cannot find error message for key "{0}"


Reply via email to