octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rethrow?


From: John W. Eaton
Subject: Re: rethrow?
Date: Mon, 26 Feb 2007 15:51:48 -0500

On  1-Feb-2007, David Bateman wrote:

| How about something like the attached patch? One issue with the attached
| patch is it won't give exactly the same error message when rethrown..
| For exampl
| 
| octave:1>sind
| Invalid call to sind.  Correct usage is:
| 
|  -- Function File:  sind (X)
| 
| 
| Additional help for built-in functions and operators is
| available in the on-line version of the manual.  Use the command
| `doc <topic>' to search the manual index.
| 
| Help and information about Octave is also available on the WWW
| at http://www.octave.org and via the address@hidden
| mailing list.
| 
| error: evaluating if command near line 25, column 3
| error: called from `sind' in file
| `/opt/octave-2.9/share/octave/2.9.9+/m/elfun/sind.m'
| octave:1> try, sind(); catch, rethrow(lasterror()); end
| error:
| Invalid call to sind.  Correct usage is:
| 
|  -- Function File:  sind (X)
| 
| 
| Additional help for built-in functions and operators is
| available in the on-line version of the manual.  Use the command
| `doc <topic>' to search the manual index.
| 
| Help and information about Octave is also available on the WWW
| at http://www.octave.org and via the address@hidden
| mailing list.
| 
| error: called from `sind' in file
| /opt/octave-2.9/share/octave/2.9.9+/m/elfun/sind.m near line 26, column 5:
| octave:2>
| 
| As you see the "evaluating if ..." part of the error message is not
| reproduced, although the line and column numbers are.. If this is a
| problem, it will be much harder to implement this feature as you'd have
| to hook into all of the error traceback code in all of the octave_value
| classes. Is this worth it?

I think the way errors are handled will need some reworking
eventually, but I don't think we should worry about that now.

Please check in this change.

Sorry for the delay.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]