octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #58411] cellfun with "ErrorHandler" returns wr


From: Rik
Subject: [Octave-bug-tracker] [bug #58411] cellfun with "ErrorHandler" returns wrong message
Date: Thu, 12 Nov 2020 10:06:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36

Follow-up Comment #18, bug #58411 (project octave):

I think this is a different problem.  The warning() function only prints
something if the ID is not empty.  This is Matlab-compatible because a common
construct might be


warnmsg = '';
... code which assigns warnmsg only if a problem is found ...
warning (warnmsg);


This produces a warning only when warnmsg is not empty.  The same thing
applies to the warning ID as well.

In this case, I modified your ErrorHandler function to test


isempty (S.identifier)


and it is empty so no warning is printed.

This makes sense because if you look at factorial.m the input validation is


    error ("factorial: all N must be real non-negative integers");


Perhaps it would be a good future project to make sure that every warning and
every error function call in Octave core had an associated ID, but that will
be a lot of work and wouldn't be done for the 6.1 release.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58411>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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