camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1031452 - in /camel/trunk/components: camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
Date Fri, 05 Nov 2010 06:40:32 GMT
Author: davsclaus
Date: Fri Nov  5 06:40:32 2010
New Revision: 1031452

URL: http://svn.apache.org/viewvc?rev=1031452&view=rev
Log:
CAMEL-3313: Include resource details in the caused exception when failed to compile stylesheet
in XSLT.

Modified:
    camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java

Modified: camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java?rev=1031452&r1=1031451&r2=1031452&view=diff
==============================================================================
--- camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
(original)
+++ camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
Fri Nov  5 06:40:32 2010
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.xslt;
 
 import org.apache.camel.builder.RouteBuilder;

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java?rev=1031452&r1=1031451&r2=1031452&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
Fri Nov  5 06:40:32 2010
@@ -17,10 +17,12 @@
 package org.apache.camel.component.xslt;
 
 import java.util.Map;
+import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.URIResolver;
 
 import org.apache.camel.Endpoint;
+import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.builder.xml.ResultHandlerFactory;
 import org.apache.camel.builder.xml.XsltBuilder;
 import org.apache.camel.builder.xml.XsltUriResolver;
@@ -117,7 +119,13 @@ public class XsltComponent extends Resou
         String output = getAndRemoveParameter(parameters, "output", String.class);
         configureOutput(xslt, output);
 
-        xslt.setTransformerInputStream(resource.getInputStream());
+        try {
+            xslt.setTransformerInputStream(resource.getInputStream());
+        } catch (Exception e) {
+            // include information about the resource in the caused exception, so its easier
for
+            // end users to know which resource failed
+            throw new TransformerConfigurationException(e.getMessage() + " " + resource.toString(),
e);
+        }
         configureXslt(xslt, uri, remaining, parameters);
         return new ProcessorEndpoint(uri, this, xslt);
     }



Mime
View raw message