ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Parsing ConTeXt errors
@ 2016-10-11 13:27 Nicola
  2016-10-11 18:52 ` Alan Braslau
  0 siblings, 1 reply; 7+ messages in thread
From: Nicola @ 2016-10-11 13:27 UTC (permalink / raw)
  To: ntg-context

Hello,

I'm trying to parse ConTeXt errors. TeX and Lua errors seem easy to parse
(search for 'tex error' and 'lua error', respectively), but I have a couple of
problems with MetaPost messages.

First, when there are MetaPost errors, context/mtxrun exits with a zero exit
code. Is that intentional?

Second, as far as I see, there is no way to locate the error in the source
from the log. I can only retrieve the file causing the error (by searching for
an 'open source' line - very useful, btw), but no line number.

Am I missing something? I think it would be very useful to have at least an
approximate indication of the position of a MetaPost error.

Nicola



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-11 13:27 Parsing ConTeXt errors Nicola
@ 2016-10-11 18:52 ` Alan Braslau
  2016-10-11 19:37   ` Nicola
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Braslau @ 2016-10-11 18:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost        > error: 


Alan


> On Oct 11, 2016, at 07:27, Nicola <nvitacolonna@gmail.com> wrote:
> 
> Hello,
> 
> I'm trying to parse ConTeXt errors. TeX and Lua errors seem easy to parse
> (search for 'tex error' and 'lua error', respectively), but I have a couple of
> problems with MetaPost messages.
> 
> First, when there are MetaPost errors, context/mtxrun exits with a zero exit
> code. Is that intentional?
> 
> Second, as far as I see, there is no way to locate the error in the source
> from the log. I can only retrieve the file causing the error (by searching for
> an 'open source' line - very useful, btw), but no line number.
> 
> Am I missing something? I think it would be very useful to have at least an
> approximate indication of the position of a MetaPost error.
> 
> Nicola
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-11 18:52 ` Alan Braslau
@ 2016-10-11 19:37   ` Nicola
  2016-10-11 22:13     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Nicola @ 2016-10-11 19:37 UTC (permalink / raw)
  To: ntg-context

On 2016-10-11 18:52:32 +0000, Alan Braslau said:

> Of course, I *never* make MetaPost errors... ;-)
> 
> However, you can search the log file for
> metapost        > error:

Sure. But there is no line number. Compare with a typical TeX error:

tex error       > tex error on line 210 in file /path/to/main.tex: ! 
Undefined control sequence

l.210 \sdkjdkjhkdkkjk

In the same line you see:

1) the type of error (tex error);
2) the line number;
3) the file in which the error occurs;
4) the error message.

For MetaPost errors, only 1) and 4) are given with the error; 3) may be 
inferred
(by tracking `open source`/`close source` lines). But I see no trace of 2).

Nicola


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-11 19:37   ` Nicola
@ 2016-10-11 22:13     ` Hans Hagen
  2016-10-12  7:30       ` Nicola
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2016-10-11 22:13 UTC (permalink / raw)
  To: ntg-context

On 10/11/2016 9:37 PM, Nicola wrote:
> On 2016-10-11 18:52:32 +0000, Alan Braslau said:
>
>> Of course, I *never* make MetaPost errors... ;-)
>>
>> However, you can search the log file for
>> metapost        > error:
>
> Sure. But there is no line number. Compare with a typical TeX error:

because there are no lines ... the library gets strings

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-11 22:13     ` Hans Hagen
@ 2016-10-12  7:30       ` Nicola
  2016-10-13 18:37         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Nicola @ 2016-10-12  7:30 UTC (permalink / raw)
  To: ntg-context

On 2016-10-11 22:13:12 +0000, Hans Hagen said:

> On 10/11/2016 9:37 PM, Nicola wrote:
>> On 2016-10-11 18:52:32 +0000, Alan Braslau said:
>> 
>>> Of course, I *never* make MetaPost errors... ;-)
>>> 
>>> However, you can search the log file for
>>> metapost        > error:
>> 
>> Sure. But there is no line number. Compare with a typical TeX error:
> 
> because there are no lines ... the library gets strings

Would it be possible to report at least the location of the enclosing
\...MP... block?

Nicola


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-12  7:30       ` Nicola
@ 2016-10-13 18:37         ` Hans Hagen
  2016-10-13 19:00           ` Nicola
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2016-10-13 18:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10/12/2016 9:30 AM, Nicola wrote:
> On 2016-10-11 22:13:12 +0000, Hans Hagen said:
>
>> On 10/11/2016 9:37 PM, Nicola wrote:
>>> On 2016-10-11 18:52:32 +0000, Alan Braslau said:
>>>
>>>> Of course, I *never* make MetaPost errors... ;-)
>>>>
>>>> However, you can search the log file for
>>>> metapost        > error:
>>>
>>> Sure. But there is no line number. Compare with a typical TeX error:
>>
>> because there are no lines ... the library gets strings
>
> Would it be possible to report at least the location of the enclosing
> \...MP... block?

it will always be the line where such a block ends, i adapted the 
message a bit

tex error       > mp error on line 51 in file e:/tmp/oeps.tex:

 >> foo
! Isolated expression.
<to be read again>
;
<*> ...draw fullcircle scaled (i) ; endfor ; foo ;

I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.

(the extra details at the end will be available in the next luatex 
binary as it needs an updated mplibrary).

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parsing ConTeXt errors
  2016-10-13 18:37         ` Hans Hagen
@ 2016-10-13 19:00           ` Nicola
  0 siblings, 0 replies; 7+ messages in thread
From: Nicola @ 2016-10-13 19:00 UTC (permalink / raw)
  To: ntg-context

On 2016-10-13 18:37:38 +0000, Hans Hagen said:

> On 10/12/2016 9:30 AM, Nicola wrote:
>> On 2016-10-11 22:13:12 +0000, Hans Hagen said:
>> 
>>> On 10/11/2016 9:37 PM, Nicola wrote:
>>>> On 2016-10-11 18:52:32 +0000, Alan Braslau said:
>>>> 
>>>>> Of course, I *never* make MetaPost errors... ;-)
>>>>> 
>>>>> However, you can search the log file for
>>>>> metapost        > error:
>>>> 
>>>> Sure. But there is no line number. Compare with a typical TeX error:
>>> 
>>> because there are no lines ... the library gets strings
>> 
>> Would it be possible to report at least the location of the enclosing
>> \...MP... block?
> 
> it will always be the line where such a block ends, i adapted the
> message a bit
> 
> tex error       > mp error on line 51 in file e:/tmp/oeps.tex:
> 
>  >> foo
> ! Isolated expression.
> <to be read again>
> ;
> <*> ...draw fullcircle scaled (i) ; endfor ; foo ;
> 
> I couldn't find an `=' or `:=' after the
> expression that is shown above this error message,
> so I guess I'll just ignore it and carry on.
> 
> (the extra details at the end will be available in the next luatex
> binary as it needs an updated mplibrary).

Looks good, looking forward to trying it!

Nicola


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-13 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 13:27 Parsing ConTeXt errors Nicola
2016-10-11 18:52 ` Alan Braslau
2016-10-11 19:37   ` Nicola
2016-10-11 22:13     ` Hans Hagen
2016-10-12  7:30       ` Nicola
2016-10-13 18:37         ` Hans Hagen
2016-10-13 19:00           ` Nicola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).