help-octave
[Top][All Lists]
Advanced

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

getting a full stack back trace in a catch block


From: John W. Eaton
Subject: getting a full stack back trace in a catch block
Date: Fri, 1 May 2009 14:04:01 -0400

On  1-May-2009, Gerard Choinka wrote:

| how do i get a full stack back trace  in an catch block, lasterror
| gives me only the first occurrence of the error,
| 
| e.g.
| 
| function foo() error("an error"); end
| function bar() foo(); end
| try bar(); catch disp(lasterror()); end
| 
| gives me only
| {
|   message = error: an error
| 
|   identifier =
|   stack =
|   {
|     file =
|     name = foo
|     line =  1
|     column =  16
|   }
| }
| 
| when i just call bar() i'm getting in addition the information that
| foo was called from bar
| bar()
| error: an error
| error: called from `foo'
| error: called from `bar'
| 
| i'm running octave 3.0.1 - octave 3.0.3 on linux and windows

I just checked in the following patch

  http://hg.savannah.gnu.org/hgweb/octave/rev/69088b7b139c

so the problem should be fixed in the upcoming 3.2 release.  This
patch will not work with Octave 3.0.x.

jwe


reply via email to

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