New message when grammar file not found #2461 #3124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Robert D Anderson robander@us.ibm.com
Implements #2461 (also reported as #2475 and reported in Slack today in relation to #3123) by adding new message to distinguish between "file not found" conditions. Currently, if any file cannot be found, we report the file we're trying to read (usually a DITA map or topic) and state that it cannot be found or loaded. If the DTD/Schema is missing, the
FileNotFoundException
actually applies to that grammar file, but we only report the source file. If the file exists but we receive theFileNotFound
condition, then most likely it's a grammar file that was not found, so we should modify the message accordingly.Old behavior:
SaxParseException
that reports the correct file (source or grammar) along with the parsing errorFileNotFoundException
and report the source file that could not be used. If it's the input file end with fatal "Input file could not be located or read, ensure it exists and you have permission", otherwise use an Error "File could not be located or read"New behavior:
SaxParseException
that reports the correct file (source or grammar) along with the parsing errorFileNotFoundException
for the input file, but the input file really does exist, use a new fatal message "Input file XYZ could not be loaded" and point to the grammar file as the response; after that message include the actual exception text that states what file could not be found, such asmap.dtd
FileNotFoundException
for any other file that really does exist, use a new error "File XYZ cannot be loaded" and point to the grammar file as the cause; after that message include the actual exception text that states what file could not be found, such asmy-topic.dtd
FileNotFoundException
as we do today