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

Add a New Comment Rich Markup
   

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>

 

(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 yasirroni (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code