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

 
 

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

Submitted by:  Michael C. Grant <mcgrant>
Submitted on:  Mon 06 Jan 2014 03:56:12 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: mcg@cvxr.comOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project Administrator
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by fgnievinski (Posted a comment)
  • -unavailable- added by dac922 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by mcgrant (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Jan 2014 03:46:38 AM UTCmtmillerStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Mon 06 Jan 2014 04:11:37 AM UTCmtmillerStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1