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

New message when grammar file not found #2461 #3124

Merged
merged 1 commit into from Oct 24, 2018
Merged

Conversation

robander
Copy link
Member

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 the FileNotFound condition, then most likely it's a grammar file that was not found, so we should modify the message accordingly.

Old behavior:

  • If the file cannot be parsed (because the file contents are not valid against the grammar, or because the grammar file itself cannot be parsed), there is a SaxParseException that reports the correct file (source or grammar) along with the parsing error
  • Otherwise if any file could not be found, catch FileNotFoundException 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:

  • If the file cannot be parsed (because the file contents are not valid against the grammar, or because the grammar file itself cannot be parsed), there is a SaxParseException that reports the correct file (source or grammar) along with the parsing error
  • If we get the FileNotFoundException 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 as map.dtd
  • If we get the 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 as my-topic.dtd
  • Otherwise treat the FileNotFoundException as we do today

Signed-off-by: Robert D Anderson <robander@us.ibm.com>
@robander robander added priority/medium Medium (or unknown) priority issue enhancement Changes to an existing feature labels Oct 23, 2018
@robander robander self-assigned this Oct 23, 2018
@robander robander added this to In progress in 3.2 via automation Oct 23, 2018
@robander robander moved this from In progress to Review in 3.2 Oct 23, 2018
@raducoravu
Copy link
Member

👍 We periodically have end users who forget to properly integrate their specialization plugins and encounter this problem.

@robander robander merged commit 4aff11e into develop Oct 24, 2018
3.2 automation moved this from Review to Done Oct 24, 2018
@robander robander deleted the hotfix/2461 branch October 24, 2018 13:23
@robander robander added this to the 3.2 milestone Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Changes to an existing feature preprocess priority/medium Medium (or unknown) priority issue
Projects
No open projects
3.2
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants