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

Provide meaningful warning for conref="" #3217

Merged
merged 2 commits into from Feb 18, 2019

Conversation

Projects
2 participants
@robander
Copy link
Member

commented Feb 14, 2019

When I have conref="" in my source files, the Gen List step + the map-reader and topic-reader steps treat the attribute as a valid reference. They try to read the "file" referenced by @conref, which the operating system interprets as an attempt to read the directory, resulting in the following error:

[gen-list] [DOTJ013E][ERROR] Failed to parse the referenced file 'file:/C:/DITA-OT/TESTGITHUB/emptyconref/'.: file:/C:/DITA-OT/TESTGITHUB/emptyconref/ Line 1:Content is not allowed in prolog.

I've encountered this in a lot of different documents over the last few weeks. The current message is meaningless for an author who has not encountered this recently, and does not even list the source file, resulting in a lot of difficult debugging for most people.

This update checks for an empty value. If the attribute is empty, it generates a new (better) warning message, and ignores the reference so that we do not try to read the directory. (The conref processing already knows to skip an empty value.) With this update, the build now reports a more useful message:
[gen-list] file:/C:/DITA-OT/TESTGITHUB/emptyconref/emptyconref.dita:10:15: [DOTJ081W][WARN] Ignoring empty conref attribute (conref="").

robander added some commits Feb 14, 2019

Add test for conref error condition
Signed-off-by: Robert D Anderson <robander@us.ibm.com>
Improve handling of empty conref
Signed-off-by: Robert D Anderson <robander@us.ibm.com>

@robander robander added this to In progress in 3.3 via automation Feb 14, 2019

@robander robander moved this from In progress to Needs review in 3.3 Feb 14, 2019

3.3 automation moved this from Needs review to Reviewer approved Feb 16, 2019

@robander robander merged commit 244eb16 into develop Feb 18, 2019

4 checks passed

DCO DCO
Details
WIP Ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

3.3 automation moved this from Reviewer approved to Done Feb 18, 2019

@robander robander deleted the hotfix/emptyconref branch Feb 18, 2019

@robander robander added this to the 3.3 milestone Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.