Project

Profile

Help

Bug #5606

closed

Duplicate source error message in exception (Saxon 11)

Added by Radu Coravu over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2022-07-15
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:

Description

In the method net.sf.saxon.resource.ActiveSAXSource.deliver(Receiver, ParseOptions) there is this throw:

 throw new XPathException("I/O error reported by XML parser processing " +
                                             getSystemId() + ": " + err.getMessage(), err);

which adds the source message to the initial message. But the method "net.sf.saxon.trans.XPathException.getMessage()" again uses the exception source message. So you end up with a reported error message which contains the same message twice like:

I/O error reported by XML parser processing : file not found: file not found


Related issues

Related to SaxonC - Bug #5561: misleading error message on failure to find external DTDNewO'Neil Delpratt2022-06-11

Actions
Actions #1

Updated by Michael Kay over 2 years ago

  • Related to Bug #5561: misleading error message on failure to find external DTD added
Actions #2

Updated by Michael Kay over 2 years ago

See also bug #5561, comment 5.

Actions #3

Updated by Michael Kay over 2 years ago

  • Category set to Diagnostics
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Applies to branch 11, trunk added
  • Fix Committed on Branch 11, trunk added

Fixed as suggested. Tested as follows: ran from the command line, with a source document whose DOCTYPE points to a non-existent DTD file.

On SaxonJ the message is now:

I/O error reported by XML parser processing file:/Users/xxxx...../samples/data/books.xml: /Users/xxxx...../samples/data/bookszz.dtd (No such file or directory)

On SaxonCS the message is:

Error reported by XML parser processing file:///Users/xxxx...../samples/data/books.xml: Cannot resolve external DTD subset - public ID = '', system ID = 'bookszz.dtd'.

Actions #4

Updated by Radu Coravu over 2 years ago

Thank you.

Actions #5

Updated by Debbie Lockett over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 11.4 added

Bug fix applied in the Saxon 11.4 maintenance release.

Actions #6

Updated by Radu Coravu over 2 years ago

I think my judgement about this was wrong, the method "XPathException.getMessage()" actually seems to be filtered out by your custom compilation process when the Java JAR library is created, the method is there only for the CSharp distribution.

So the code which added the error message to the initial exception error message in ActiveSAXSource.deliver was probably correct as it was, at least for the Java Saxon Library.

Actions #7

Updated by Michael Kay over 2 years ago

I'm comfortable that the change I made should be OK for all platforms.

Please register to edit this issue

Also available in: Atom PDF