bugGNU Octave - Bugs: bug #60487, wishlist: set unknown property...

 
 

bug #60487: wishlist: set unknown property error should name property

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Fri 30 Apr 2021 05:23:04 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  * Closed
Release:  * 6.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 03 May 2021 03:37:03 PM UTC, comment #4: 

yes, i think that covers it.

Nicholas Jankowski <nrjank>
Group Member
Mon 03 May 2021 03:25:50 PM UTC, comment #3: 


> so it seems the issues is just when calling set with a property and no value?


Yes, this is not ideal.  I checked the code and we give an error message that includes the invalid property name in all other cases except this one.  That just looks like an oversight.  I fixed that here: http://hg.savannah.gnu.org/hgweb/octave/rev/f72796c1ccbc.

Is that good enough?  Marking as Ready for Test.

Rik <rik5>
Group administrator
Mon 03 May 2021 11:53:28 AM UTC, comment #2: 

so it seems the issues is just when calling set with a property and no value?


h = axes();
set(h, 'foobar')
error: set: unknown property


pulling from the other report that inspired this one, hist permits a string input for the 2nd argument, and passes it down to bar which calls set thinking it's a property.


data = [1 1 2 2 2 3 3 4 5 5];
string1 = "A B C D E";

>> hist(data,string1)
error: set: unknown property
error: called from
    __bar__>bars at line 349 column 10
    __bar__ at line 209 column 12
    bar at line 124 column 18
    hist at line 237 column 5


but if I supply an invalid property/value pair:



>> hist(data,string1,string2)
error: set: unknown hggroup property A B C D E
error: called from
    __bar__>bars at line 349 column 10
    __bar__ at line 209 column 12
    bar at line 124 column 18
    hist at line 237 column 5


is there a rationale for set not providing the error for the first?

Nicholas Jankowski <nrjank>
Group Member
Mon 03 May 2021 03:36:39 AM UTC, comment #1: 

Could you offer a specific example for clarity?

I tried


h = axes ();
set (h, 'foobar', 1)
error: set: unknown axes property foobar


The error mentions the object (axes) and the property name that was incorrect (foobar).  This seems to be what you are looking for.

Rik <rik5>
Group administrator
Fri 30 Apr 2021 05:23:04 PM UTC, original submission:  

just a usability request for better user feedback. request that when set issues an unknown property error, it would echo the string that it was passed triggering the error. 

see for reference bug #60482 where hist misinterprets a char array input as a plotting property and sending it to bar & set.  the equivalent of

error('set: unknown property %s', property)

would provide better feedback to the user, but it's a compiled function so that would require whatever the c-code equivalent is.  Also recognize that changing error message format would require parsing the codebase for BISTS checking for that error message to make sure it doesn't trigger a bunch of false-test errors.

Nicholas Jankowski <nrjank>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by nrjank (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-03 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-05-03 rik5 StatusWorks For Me Ready For Test
    2021-05-03 rik5 StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code