You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2021/01/19 16:43:54 UTC

[tapestry-5] branch master updated: Better handling of module class exceptions

This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/master by this push:
     new 6377566  Better handling of module class exceptions
6377566 is described below

commit 6377566c26f8fe8043da5f82c683c4e18095553c
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Tue Jan 19 13:43:40 2021 -0300

    Better handling of module class exceptions
    
    such as class not found, etc.
---
 .../apache/tapestry5/ioc/internal/DefaultModuleDefImpl.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImpl.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImpl.java
index 9e07fa3..adbd8e0 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImpl.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImpl.java
@@ -15,6 +15,7 @@
 package org.apache.tapestry5.ioc.internal;
 
 import org.apache.tapestry5.commons.*;
+import org.apache.tapestry5.commons.internal.util.TapestryException;
 import org.apache.tapestry5.commons.services.PlasticProxyFactory;
 import org.apache.tapestry5.commons.util.CollectionFactory;
 import org.apache.tapestry5.func.F;
@@ -128,7 +129,17 @@ public class DefaultModuleDefImpl implements ModuleDef2, ServiceDefAccumulator
         // might
         // have typos, i.e., "createFoo" that should be "buildFoo".
 
-        Set<Method> methods = CollectionFactory.newSet(moduleClass.getMethods());
+        Set<Method> methods;
+        try 
+        {
+            methods = CollectionFactory.newSet(moduleClass.getMethods());
+        }
+        catch (Exception e)
+        {
+            throw new TapestryException(
+                    "Exception while processing module class " + moduleClass.getName() +
+                    ": " + e.getMessage(), e);
+        }
 
         Iterator<Method> methodIterator = methods.iterator();