bugGNU Octave - Bugs: bug #66060, Try catch save will print warning...

 
 

bug #66060: Try catch save will print warning without id to be disabled

Submitter:  Muhammad Yasirroni <yasirroni>
Submitted:  Mon 05 Aug 2024 02:43:23 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  yasirroni Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 05 Aug 2024 02:43:23 AM UTC, original submission:  

I want to disable warning if user give result containing function. The problem is that the warning didn't have any ID (no msgid).


try
    result = @sin;
    output_file = 'foo.mat';
    save('-v6', '-mat-binary', output_file, 'result', 'err');
catch ME
    [msg, msgid] = lastwarn();
    disp(msg)  % disp("save: wrong type argument 'function handle'")
    disp(msgid)  % disp('')
end


Furthermore, it's kind of duplicate of warning and error. See this:


result = @sin;
output_file = 'foo.mat';
save('-v6', '-mat-binary', output_file, 'result', 'err');


Will print:


warning: save: wrong type argument 'function handle'
warning: called from
    ... at line 3 column 1

error: save: error while writing 'result' to MAT file
error: called from
    ... at line 3 column 1


Expected behavior is to only throw error, with 'function handle' info. But, if both warning and error is the desired behavior, please add msgid so I can disabled that specific warning.

Muhammad Yasirroni <yasirroni>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by yasirroni (Submitted the item)
  •  

    Votes

    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.

     

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-11ef.
    Corresponding source code