Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in catch lacks useful information for p:load #304

Open
dwcramer opened this issue Apr 23, 2020 · 0 comments
Open

Error message in catch lacks useful information for p:load #304

dwcramer opened this issue Apr 23, 2020 · 0 comments

Comments

@dwcramer
Copy link

See also issue #303.

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>

It would be super useful if I could tell them whether the parsing of the file failed because of an unresolved entity or if it's instead an unclosed tag. The parser certainly knows that--it shows up in the "Underlying exception" in the stack trace:

lineNumber: 9; columnNumber: 55; The entity "foo" was referenced, but not declared.

Couldn't Calabash parser put that stack trace in a c:error and let me deal with it? After all, I'm using a try/catch because I want to catch exceptions. I can then present that stack trace to the user with all its useful information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant