octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: style for error and warning messages


From: Mike Miller
Subject: Re: style for error and warning messages
Date: Thu, 18 Dec 2014 13:13:33 -0500

On Thu, Dec 18, 2014 at 11:45:59 -0500, John W. Eaton wrote:
> Currently, most of Octave uses a style for error and warning messages that
> is something like this:
>
>   warning ("nchoosek: possible loss of precision");
>
> but now that error and warning messages display stack trace information by
> default, having the name of the function as a prefix for the message is
> redundant.  Does anyone object to removing the function name as a prefix to
> error and warning messages?

I think it works better the way it is now. IMHO it's still very
helpful to see the function name in the primary message line. The rest
of the stack trace is useful, but can probably be safely ignored by
novice users.

It seems to me there may also be a lot of code, both within and
outside of Octave, that relies on the current behavior. For example,
using catch or lasterr and redisplaying the message alone, or even
searching for the function name in the error string. Or possibly many
%!error validation tests that are pattern matching for the function
name.

There is also the trailing newline feature of the error function,
which is used throughout Octave and OF packages to inhibit the default
stack trace. In that case there would be no clue where the error is
coming from.

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]