Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 19796 invoked by uid 500); 31 May 2001 10:14:34 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 17447 invoked from network); 31 May 2001 10:11:09 -0000 Message-ID: <20010531101118.2516.qmail@web3707.mail.yahoo.com> Date: Thu, 31 May 2001 03:11:18 -0700 (PDT) From: Jiri Luzny Subject: Re: "redirect-to resource" and substitution of the List of Maps To: cocoon-dev@xml.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Could you guys commit the patch to cvs? It is just better exception handling of the AbstractSitemap.invokeMethod(). thank you, Jiri. btw: is there any specification of proper exception handling used in Cocoon? =================================================================== RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v retrieving revision 1.2 diff -u -r1.2 AbstractSitemap.java --- AbstractSitemap.java 2001/05/18 11:04:23 1.2 +++ AbstractSitemap.java 2001/05/29 12:26:24 @@ -262,13 +262,19 @@ * @exception Exception If an error occurs during method invocation */ protected boolean invokeMethod(String methodName, Class[] argTypes, Object[] argValues) throws Exception { - try { - java.lang.reflect.Method method = this.getClass().getDeclaredMethod(methodName, argTypes); - return ((Boolean) method.invoke(this, argValues)).booleanValue(); - } catch (Exception e) { - throw new Exception ("Sitemap: " + methodName + " not found"); - } - } + try { + getLogger().debug("Dynamically invoking " + methodName); + java.lang.reflect.Method method = this.getClass().getDeclaredMethod(methodName, argTypes); + return ((Boolean) method.invoke(this, argValues)).booleanValue(); + } catch (NoSuchMethodException e) { + getLogger().error("AbstractSitemap:invokeMethod()", e); + int prefix = methodName.indexOf("_"); + throw new Exception ("Sitemap: " + methodName.substring(0,prefix) + " '" + methodName.substring(prefix + 1) + "' not found"); + } catch (Exception e) { + getLogger().error("AbstractSitemap:invokeMethod()", e); + throw e; + } + } /** * dispose __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org