You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by je...@apache.org on 2003/05/03 13:14:05 UTC
cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp XSPModuleHelper.java
jefft 2003/05/03 04:14:05
Modified: src/java/org/apache/cocoon/components/language/markup/xsp
XSPModuleHelper.java
Log:
- Tighten contract by throwing CascadingRuntimeException instead of
RuntimeException. This allows clients to re-throw the original error with a
more user-oriented error message
- Improve error message slightly
Revision Changes Path
1.3 +5 -4 cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPModuleHelper.java
Index: XSPModuleHelper.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPModuleHelper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSPModuleHelper.java 16 Mar 2003 17:49:12 -0000 1.2
+++ XSPModuleHelper.java 3 May 2003 11:14:05 -0000 1.3
@@ -109,9 +109,10 @@
* @param objectModel a <code>Map</code> value holding the current
* ObjectModel
* @return an <code>Object</code> value
- * @exception RuntimeException if an error occurs
+ * @exception CascadingRuntimeException if an error occurs. The real
+ * exception can be obtained with <code>getCause</code>.
*/
- private Object get(int op, String name, String attr, Map objectModel, Configuration conf) throws RuntimeException {
+ private Object get(int op, String name, String attr, Map objectModel, Configuration conf) throws CascadingRuntimeException {
Object value = null;
InputModule input = null;
@@ -149,7 +150,7 @@
};
} catch (Exception e) {
- throw new CascadingRuntimeException("A problem obtaining a value from "+name+" occurred: "+e,e);
+ throw new CascadingRuntimeException("Error accessing attribute '"+attr+"' from input module '"+name+"': "+e,e);
}
return value;