Improved errors reporting?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Improved errors reporting?

gamussa
Hi,

We cut our book into separate chapters/asciidoc files.
With asciidoctor it's not obvious what file has issues.

Consider following example:

asciidoctor: WARNING: list item index: expected 1, got 4
asciidoctor: WARNING: list item index: expected 2, got 5
asciidoctor: WARNING: line 11300: callout list item index: expected 4 got 1
asciidoctor: WARNING: line 11300: no callouts refer to list item 4
asciidoctor: WARNING: line 11301: callout list item index: expected 5 got 2
asciidoctor: WARNING: list item index: expected 1, got 6
asciidoctor: WARNING: line 11319: no callouts refer to list item 5
asciidoctor: WARNING: line 13068: callout list item index: expected 4 got 3
asciidoctor: WARNING: line 13070: callout list item index: expected 5 got 4
asciidoctor: WARNING: line 13072: callout list item index: expected 6 got 5
asciidoctor: WARNING: line 13074: callout list item index: expected 7 got 6
Time to read and parse source: 0.48466
Time to render document: 0.63502
Total time to read, parse and render: 1.11979


And this is how original asciidoc reports about errors:

source-highlight: missing feature: language inference requires input file
source-highlight: could not find a language definition for javascrpt
asciidoc: WARNING: ch1_html.asciidoc: line 858: filter non-zero exit code: source-highlight -f xhtml -s javascrpt: returned 1
asciidoc: WARNING: ch1_html.asciidoc: line 858: no output from filter: source-highlight -f xhtml -s javascrpt
source-highlight: missing feature: language inference requires input file
source-highlight: could not find a language definition for javascrpt
asciidoc: WARNING: ch1_html.asciidoc: line 865: filter non-zero exit code: source-highlight -f xhtml -s javascrpt: returned 1
asciidoc: WARNING: ch1_html.asciidoc: line 865: no output from filter: source-highlight -f xhtml -s javascrpt
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 448: no callouts refer to list item 1
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 711: list item index: expected 4 got 3
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 713: list item index: expected 5 got 4
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 715: list item index: expected 6 got 5
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 717: list item index: expected 7 got 6
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 717: no callouts refer to list item 7


Am I missing something? Any suggestions?

Thanks,
Vik
Reply | Threaded
Open this post in threaded view
|

Re: Improved errors reporting?

mojavelinux
Administrator
Vik,

The lack of context in these warning / error messages is due to the fact that the Reader does not currently keep track of the context from which included lines are read. Instead, it appends the lines to the Reader and throws away the context.

I'm currently working on a new Reader implementation that is going to properly track the context of included lines. That means the file name will be shown and the line number will be correct relative to the lines in that file. This design will also allow us to handle the case when a subset of lines in the file are included into the main document.

I plan to integrate the new Reader before the 0.1.4 release. I'll post to the list once its available for review and testing. I'm hoping to have it up in the next day or so.


Cheers,

-Dan


On Sat, Jun 29, 2013 at 4:42 PM, gamussa [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

We cut our book into separate chapters/asciidoc files.
With asciidoctor it's not obvious what file has issues.

Consider following example:

asciidoctor: WARNING: list item index: expected 1, got 4
asciidoctor: WARNING: list item index: expected 2, got 5
asciidoctor: WARNING: line 11300: callout list item index: expected 4 got 1
asciidoctor: WARNING: line 11300: no callouts refer to list item 4
asciidoctor: WARNING: line 11301: callout list item index: expected 5 got 2
asciidoctor: WARNING: list item index: expected 1, got 6
asciidoctor: WARNING: line 11319: no callouts refer to list item 5
asciidoctor: WARNING: line 13068: callout list item index: expected 4 got 3
asciidoctor: WARNING: line 13070: callout list item index: expected 5 got 4
asciidoctor: WARNING: line 13072: callout list item index: expected 6 got 5
asciidoctor: WARNING: line 13074: callout list item index: expected 7 got 6
Time to read and parse source: 0.48466
Time to render document: 0.63502
Total time to read, parse and render: 1.11979


And this is how original asciidoc reports about errors:

source-highlight: missing feature: language inference requires input file
source-highlight: could not find a language definition for javascrpt
asciidoc: WARNING: ch1_html.asciidoc: line 858: filter non-zero exit code: source-highlight -f xhtml -s javascrpt: returned 1
asciidoc: WARNING: ch1_html.asciidoc: line 858: no output from filter: source-highlight -f xhtml -s javascrpt
source-highlight: missing feature: language inference requires input file
source-highlight: could not find a language definition for javascrpt
asciidoc: WARNING: ch1_html.asciidoc: line 865: filter non-zero exit code: source-highlight -f xhtml -s javascrpt: returned 1
asciidoc: WARNING: ch1_html.asciidoc: line 865: no output from filter: source-highlight -f xhtml -s javascrpt
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 448: no callouts refer to list item 1
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 711: list item index: expected 4 got 3
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 713: list item index: expected 5 got 4
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 715: list item index: expected 6 got 5
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 717: list item index: expected 7 got 6
asciidoc: WARNING: ch12_jquerymobile.asciidoc: line 717: no callouts refer to list item 7


Am I missing something? Any suggestions?

Thanks,
Vik


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Improved-errors-reporting-tp356.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Improved errors reporting?

mojavelinux
Administrator
I think you'll appreciate this output, which I got from running Asciidoctor master in the Enterprise Web Book build.sh:

asciidoctor: WARNING: ch1_advancedjs.asciidoc: line 1737: no callouts refer to list item 1
asciidoctor: WARNING: ch2_html.asciidoc: line 1121: no callouts refer to list item 1
asciidoctor: WARNING: ch3_mockup.asciidoc: line 298: no callouts refer to list item 1
asciidoctor: WARNING: ch3_mockup.asciidoc: line 301: no callouts refer to list item 2
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 71: no callouts refer to list item 1
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 73: no callouts refer to list item 2
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 75: no callouts refer to list item 3
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 585: no callouts refer to list item 1
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 787: no callouts refer to list item 1
asciidoctor: WARNING: ch7_large_js_apps.asciidoc: line 789: no callouts refer to list item 2
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 236: no callouts refer to list item 1
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 238: no callouts refer to list item 2
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 240: no callouts refer to list item 3
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 242: no callouts refer to list item 4
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 244: no callouts refer to list item 5
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 337: no callouts refer to list item 1
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 339: no callouts refer to list item 2
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 341: no callouts refer to list item 3
asciidoctor: WARNING: ch8_testdriven_js.asciidoc: line 343: no callouts refer to list item 4
asciidoctor: WARNING: ch12_jquerymobile.asciidoc: line 433: no callouts refer to list item 1
asciidoctor: WARNING: ch12_jquerymobile.asciidoc: line 435: no callouts refer to list item 2
asciidoctor: WARNING: ch12_jquerymobile.asciidoc: line 437: no callouts refer to list item 3
asciidoctor: WARNING: ch12_jquerymobile.asciidoc: line 439: no callouts refer to list item 4
asciidoctor: WARNING: list item index: expected 4, got 5

Context! Yeah!

We're getting there ;) There are still some messages that are slipping through without line information, but it's just a matter of wiring the line information into those locations in the code.
Reply | Threaded
Open this post in threaded view
|

Re: Improved errors reporting?

mojavelinux
Administrator
Btw, don't stress about the warning messages. That's actually an issue on my end that I need to correct. With a local fix applied, the only warning message I get is the last one (which, ironically, has no context).

-Dan
Reply | Threaded
Open this post in threaded view
|

Re: Improved errors reporting?

gamussa
Yeah,
Output is more informative now!
Thanks, Dan!