discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Prefixed warnings and errors

NH
nop head
Fri, Jan 11, 2019 10:08 AM

I noticed the error and warning messages have grown a prefix, breaking my
scripts. Easy to fix but I wonder what the purpose is?. Would it be better
to strip the prefix before printing them?

I noticed the error and warning messages have grown a prefix, breaking my scripts. Easy to fix but I wonder what the purpose is?. Would it be better to strip the prefix before printing them?
MF
Michael Frey
Fri, Jan 11, 2019 5:02 PM

On 11.01.19 11:08, nop head wrote:

I noticed the error and warning messages have grown a prefix, breaking
my scripts. Easy to fix but I wonder what the purpose is?. Would it be
better to strip the prefix before printing them?

The prefixes are from the ability to stop on the first warning.

I throw an exception at the first (literal) "WARNING".

Now some warnings caused issues, as I did not find the right place to
catch the exception.

With https://github.com/openscad/openscad/pull/2667 I found one of the
slipping exceptions, now that this is merged, I can look into it what
prefixes I can now remove.

Note that I would like to keep the UI-WARNING prefixes (or something
alike) as those are really messy and clearly different from warnings
caused by user code.

With kind regards,

Michael

On 11.01.19 11:08, nop head wrote: > I noticed the error and warning messages have grown a prefix, breaking > my scripts. Easy to fix but I wonder what the purpose is?. Would it be > better to strip the prefix before printing them? The prefixes are from the ability to stop on the first warning. I throw an exception at the first (literal) "WARNING". Now some warnings caused issues, as I did not find the right place to catch the exception. With https://github.com/openscad/openscad/pull/2667 I found one of the slipping exceptions, now that this is merged, I can look into it what prefixes I can now remove. Note that I would like to keep the UI-WARNING prefixes (or something alike) as those are really messy and clearly different from warnings caused by user code. With kind regards, Michael
NH
nop head
Fri, Jan 11, 2019 5:28 PM

I am not sure how you can say the  UI-WARNING  are not caused by the user
code. I can write:

$vpr=0;

and get

UI-WARNING: Unable to convert $vpr= 0 to a vec3 or vec2 of numbers

I can subtract a cylinder from a cube of the same size to create a knife
edge and get

UI-WARNING: Object may not be a valid 2-manifold and may need repair!

The distinguishing feature seems to be that they only happen in GUI mode,
you can't get them on the command line. But that isn't really significant
to me as a user, it just looks messy. Can't you just strip them as they are
printed to avoid the console looking messy but keep them in the code if you
need the information they convey to process them?

On Fri, 11 Jan 2019 at 17:03, Michael Frey michael.frey@gmx.ch wrote:

On 11.01.19 11:08, nop head wrote:

I noticed the error and warning messages have grown a prefix, breaking
my scripts. Easy to fix but I wonder what the purpose is?. Would it be
better to strip the prefix before printing them?

The prefixes are from the ability to stop on the first warning.

I throw an exception at the first (literal) "WARNING".

Now some warnings caused issues, as I did not find the right place to
catch the exception.

With https://github.com/openscad/openscad/pull/2667 I found one of the
slipping exceptions, now that this is merged, I can look into it what
prefixes I can now remove.

Note that I would like to keep the UI-WARNING prefixes (or something
alike) as those are really messy and clearly different from warnings
caused by user code.

With kind regards,

Michael


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I am not sure how you can say the UI-WARNING are not caused by the user code. I can write: $vpr=0; and get UI-WARNING: Unable to convert $vpr= 0 to a vec3 or vec2 of numbers I can subtract a cylinder from a cube of the same size to create a knife edge and get UI-WARNING: Object may not be a valid 2-manifold and may need repair! The distinguishing feature seems to be that they only happen in GUI mode, you can't get them on the command line. But that isn't really significant to me as a user, it just looks messy. Can't you just strip them as they are printed to avoid the console looking messy but keep them in the code if you need the information they convey to process them? On Fri, 11 Jan 2019 at 17:03, Michael Frey <michael.frey@gmx.ch> wrote: > On 11.01.19 11:08, nop head wrote: > > I noticed the error and warning messages have grown a prefix, breaking > > my scripts. Easy to fix but I wonder what the purpose is?. Would it be > > better to strip the prefix before printing them? > > The prefixes are from the ability to stop on the first warning. > > I throw an exception at the first (literal) "WARNING". > > Now some warnings caused issues, as I did not find the right place to > catch the exception. > > With https://github.com/openscad/openscad/pull/2667 I found one of the > slipping exceptions, now that this is merged, I can look into it what > prefixes I can now remove. > > Note that I would like to keep the UI-WARNING prefixes (or something > alike) as those are really messy and clearly different from warnings > caused by user code. > > > With kind regards, > > Michael > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
TP
Torsten Paul
Fri, Jan 11, 2019 5:32 PM

What is the script doing with the Warning/Error lines?

ciao,
Torsten.

What is the script doing with the Warning/Error lines? ciao, Torsten.
NH
nop head
Fri, Jan 11, 2019 6:10 PM

It runs OpenSCAD, captures stdout and stderr and prints any lines beginning
with ERROR: or WARNING:. I.e. avoiding things like "Compiling design" and
"Normalized CSG tree" messages, which are not very useful.

On Fri, 11 Jan 2019 at 17:33, Torsten Paul Torsten.Paul@gmx.de wrote:

What is the script doing with the Warning/Error lines?

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

It runs OpenSCAD, captures stdout and stderr and prints any lines beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling design" and "Normalized CSG tree" messages, which are not very useful. On Fri, 11 Jan 2019 at 17:33, Torsten Paul <Torsten.Paul@gmx.de> wrote: > What is the script doing with the Warning/Error lines? > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
TP
Torsten Paul
Fri, Jan 11, 2019 6:25 PM

On 11.01.19 19:10, nop head wrote:

It runs OpenSCAD, captures stdout and stderr and prints any lines
beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling
design" and "Normalized CSG tree" messages, which are not very useful.

Hmm, so changing it to maybe ERROR:UI: could be a compromise for the
time being? I guess if we ever find the time it would make sense to
handle the information a bit more specific internally instead of relying
on the strings, but that's a quite invasive change even if not a very
complicated one.

ciao,
Torsten.

On 11.01.19 19:10, nop head wrote: > It runs OpenSCAD, captures stdout and stderr and prints any lines > beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling > design" and "Normalized CSG tree" messages, which are not very useful. Hmm, so changing it to maybe ERROR:UI: could be a compromise for the time being? I guess if we ever find the time it would make sense to handle the information a bit more specific internally instead of relying on the strings, but that's a quite invasive change even if not a very complicated one. ciao, Torsten.
NH
nop head
Fri, Jan 11, 2019 6:36 PM

Well I can easily change my script to look for ERROR: anywhere instead of
the beginning. It isn't published yet so changing is no problem at all. But
I don't like the console looking more complicated for no extra information.

On Fri, 11 Jan 2019 at 18:26, Torsten Paul Torsten.Paul@gmx.de wrote:

On 11.01.19 19:10, nop head wrote:

It runs OpenSCAD, captures stdout and stderr and prints any lines
beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling
design" and "Normalized CSG tree" messages, which are not very useful.

Hmm, so changing it to maybe ERROR:UI: could be a compromise for the
time being? I guess if we ever find the time it would make sense to
handle the information a bit more specific internally instead of relying
on the strings, but that's a quite invasive change even if not a very
complicated one.

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Well I can easily change my script to look for ERROR: anywhere instead of the beginning. It isn't published yet so changing is no problem at all. But I don't like the console looking more complicated for no extra information. On Fri, 11 Jan 2019 at 18:26, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 11.01.19 19:10, nop head wrote: > > It runs OpenSCAD, captures stdout and stderr and prints any lines > > beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling > > design" and "Normalized CSG tree" messages, which are not very useful. > > Hmm, so changing it to maybe ERROR:UI: could be a compromise for the > time being? I guess if we ever find the time it would make sense to > handle the information a bit more specific internally instead of relying > on the strings, but that's a quite invasive change even if not a very > complicated one. > > ciao, > Torsten. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
NH
nop head
Fri, Jan 11, 2019 6:47 PM

BTW, if I enable stop on first warning it seems to prevent another F5 or F6
once I get a warning. I have to turn it off to be able to continue.

OpenSCAD 2019.01.03.ci933

On Fri, 11 Jan 2019 at 18:36, nop head nop.head@gmail.com wrote:

Well I can easily change my script to look for ERROR: anywhere instead of
the beginning. It isn't published yet so changing is no problem at all. But
I don't like the console looking more complicated for no extra information.

On Fri, 11 Jan 2019 at 18:26, Torsten Paul Torsten.Paul@gmx.de wrote:

On 11.01.19 19:10, nop head wrote:

It runs OpenSCAD, captures stdout and stderr and prints any lines
beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling
design" and "Normalized CSG tree" messages, which are not very useful.

Hmm, so changing it to maybe ERROR:UI: could be a compromise for the
time being? I guess if we ever find the time it would make sense to
handle the information a bit more specific internally instead of relying
on the strings, but that's a quite invasive change even if not a very
complicated one.

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

BTW, if I enable stop on first warning it seems to prevent another F5 or F6 once I get a warning. I have to turn it off to be able to continue. OpenSCAD 2019.01.03.ci933 On Fri, 11 Jan 2019 at 18:36, nop head <nop.head@gmail.com> wrote: > Well I can easily change my script to look for ERROR: anywhere instead of > the beginning. It isn't published yet so changing is no problem at all. But > I don't like the console looking more complicated for no extra information. > > On Fri, 11 Jan 2019 at 18:26, Torsten Paul <Torsten.Paul@gmx.de> wrote: > >> On 11.01.19 19:10, nop head wrote: >> > It runs OpenSCAD, captures stdout and stderr and prints any lines >> > beginning with ERROR: or WARNING:. I.e. avoiding things like "Compiling >> > design" and "Normalized CSG tree" messages, which are not very useful. >> >> Hmm, so changing it to maybe ERROR:UI: could be a compromise for the >> time being? I guess if we ever find the time it would make sense to >> handle the information a bit more specific internally instead of relying >> on the strings, but that's a quite invasive change even if not a very >> complicated one. >> >> ciao, >> Torsten. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >