Re: Improved errors reporting?

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/Improved-errors-reporting-tp356p473.html

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.

Here's the main issue to track: https://github.com/asciidoctor/asciidoctor/issues/575

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



--
Dan Allen | http://google.com/profiles/dan.j.allen