Skip to content

Commit 196d70c

Browse files
author
Nico Verwer
committed
show xsl file and line number in transform error
1 parent 930c719 commit 196d70c

File tree

1 file changed

+4
-2
lines changed
  • exist-core/src/main/java/org/exist/xquery/functions/fn/transform

1 file changed

+4
-2
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Transform.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
192192
final Transform.TemplateInvocation invocation = new Transform.TemplateInvocation(
193193
options, sourceNode, delivery, xslt30Transformer, resultDocuments);
194194
return invocation.invoke();
195-
} catch (final SaxonApiException | UncheckedXPathException e) {
196-
throw originalXPathException("Could not transform input: ", e, ErrorCodes.FOXT0003);
195+
} catch (final SaxonApiException e) {
196+
throw originalXPathException("Could not transform with "+options.xsltSource._1+" line "+e.getLineNumber()+": ", e, ErrorCodes.FOXT0003);
197+
} catch (final UncheckedXPathException e) {
198+
throw originalXPathException("Could not transform with "+options.xsltSource._1+" line "+e.getXPathException().getLocationAsString()+": ", e, ErrorCodes.FOXT0003);
197199
}
198200

199201
} else {

0 commit comments

Comments
 (0)