Revision: 1116
          http://stripes.svn.sourceforge.net/stripes/?rev=1116&view=rev
Author:   bengunter
Date:     2009-03-11 20:30:57 +0000 (Wed, 11 Mar 2009)

Log Message:
-----------
The fix for STS-688 broke several tests because of missing resources. I changed 
it to catch MissingResourceException and add a default message instead. Problem 
is, LocalizationUtility still logs the exception at ERROR but doesn't throw it.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java  
2009-03-11 20:12:03 UTC (rev 1115)
+++ trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java  
2009-03-11 20:30:57 UTC (rev 1116)
@@ -40,6 +40,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.WeakHashMap;
@@ -508,14 +509,22 @@
     public static final void logValidationErrors(ActionBeanContext context) {
         Locale locale = context.getRequest().getLocale();
         StringBuilder buf = new StringBuilder("The following validation errors 
need to be fixed:");
+
         for (List<ValidationError> list : 
context.getValidationErrors().values()) {
             for (ValidationError error : list) {
                 String fieldName = error.getFieldName();
                 if (ValidationErrors.GLOBAL_ERROR.equals(fieldName))
                     fieldName = "GLOBAL";
 
-                buf.append("\n    -> [").append(fieldName).append("] ").append(
-                        error.getMessage(locale));
+                String message;
+                try {
+                    message = error.getMessage(locale);
+                }
+                catch (MissingResourceException e) {
+                    message = "(missing resource)";
+                }
+
+                buf.append("\n    -> [").append(fieldName).append("] 
").append(message);
             }
         }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to