geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r502539 - /geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java
Date Fri, 02 Feb 2007 08:54:41 GMT
Author: dblevins
Date: Fri Feb  2 00:54:40 2007
New Revision: 502539

URL: http://svn.apache.org/viewvc?view=rev&rev=502539
Log:
Don't chewup the exception of an injection.

Modified:
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java?view=diff&rev=502539&r1=502538&r2=502539
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java
Fri Feb  2 00:54:40 2007
@@ -233,7 +233,14 @@
                 propertyValue = convert(member.getType(), propertyValue);
                 member.setValue(instance, propertyValue);
             } catch (Exception e) {
-                throw new ConstructionException("Error setting property: " + member);
+                Throwable t = e;
+                if (e instanceof InvocationTargetException) {
+                    InvocationTargetException invocationTargetException = (InvocationTargetException)
e;
+                    if (invocationTargetException.getCause() != null) {
+                        t = invocationTargetException.getCause();
+                    }
+                }
+                throw new ConstructionException("Error setting property: " + member, t);
             }
         }
         return instance;



Mime
View raw message