Errors in p:try/p:catch yield little information when things go wrong

Greetings,

I'm using p:load to load a doc and wrap it in a p:try/p:catch in XProc 
(Calabash 1.22). When the document is malformed or unparsable, I get 
very little information about the nature of the problem in the catch:

<c:errors xmlns:c="http://www.w3.org/ns/xproc-step">
     <c:error xmlns:err="http://www.w3.org/ns/xproc-error" 
code="err:XC0011"
         href="file:/path/to/pdf.xpl"
         line="6" column="65">Could not load
         /path/to/Quinoa_Axe_Throwing_Specification.xml
         (file:/path/to/pdf.xpl)
         dtd-validate=false</c:error>
</c:errors>

Likewise, when I wrap p:include in a try/catch, I only get an error code 
indicating that it couldn't load a file and line numbers in the xpl:

<c:error href="file:/path/to/library.xpl" line="18" column="34">XProc 
error err:XD0011</c:error>

There's no information about which file or files couldn't be loaded for 
example.

I was attempting to have the pipeline package up the error information 
about why things fail and report it in a friendly way to my users. If I 
were to load the same document as the source for the pipeline and not 
use try/catch, Calabash would give me more information about why it 
failed to parse the document, which xinclude couldn't be resolved, etc 
but when I do that I have no way to recover gracefully from a failure 
within the pipeline.

Am I going about things the wrong way? It seems that I have to put this 
code in the layer that calls Calabash and scrape the unstructured 
stderr/stdout info to let the user know what went wrong.

Regards,
David

Received on Wednesday, 22 April 2020 04:48:56 UTC