bugGNU Octave - Bugs: bug #41117, Exception handling difference...

 
 

bug #41117: Exception handling difference between Matlab and Octave (and, a documentation error)

Submitter:  Michael C. Grant <mcgrant>
Submitted:  Mon 06 Jan 2014 03:56:12 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  mcg@cvxr.com Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Jan 2014 02:26:39 PM UTC, comment #5: 

Stefan, I applied a slightly modified version of your patch here:

  http://hg.savannah.gnu.org/hgweb/octave/rev/6ef8b920a7d6

Since this will be fixed in 4.0, I don't think it's really important to fix the docs in stable.

John W. Eaton <jwe>
Group administrator
Mon 06 Jan 2014 02:14:37 PM UTC, comment #4: 

and it's a patch for the code, not for the docs -- nice, thanks Stefan!  too bad it fell through the cracks, it seems...

Felipe G. Nievinski <fgnievinski>
Mon 06 Jan 2014 08:59:25 AM UTC, comment #3: 

There's already a patch available at bug #33217

Stefan Mahr <dac922>
Mon 06 Jan 2014 04:11:37 AM UTC, comment #2: 

Agreed. Can you suggest a patch to clarify the difference in the documentation until this feature is added?

See also bug #40828 to implement exceptions as proper objects, with all the expected properties.

Mike Miller <mtmiller>
Group Member
Mon 06 Jan 2014 03:57:37 AM UTC, comment #1: 

Just to clarify: a call to the lasterror function does return "identifier", "message", and "stack". A caught exception only returns the first two.

Michael C. Grant <mcgrant>
Mon 06 Jan 2014 03:56:12 AM UTC, original submission:  

In one of the most recent revisions (http://hg.savannah.gnu.org/hgweb/octave/rev/6fd22474783e), I see this description of the new exception capability:

"Alternatively, the output of the @code{lasterror} function can be found in a variable indicated immediately after the @code{catch} keyword, as in the example below showing how to redirect an error as a warning:"

This is actually not quite correct. In my tests, the "try; catch err; end" syntax returns a structure in "err" containing two fields: "identifier" and "message", but not "stack".

I would actually prefer the stack trace information be included in the exception information provided by try/catch. And if the goal is MATLAB compatibility, that this what should be done. But it does not currently seem to be the case.

Michael C. Grant <mcgrant>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by fgnievinski (Posted a comment)
  • -email is unavailable- added by dac922 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by mcgrant (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-09 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-01-06 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code