[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
usage of error_text
From: |
etienne grossmann |
Subject: |
usage of error_text |
Date: |
Sun, 9 Apr 2000 19:51:58 +0100 (WEST) |
Hello,
sorry for mailing prematurely. I think I got it : the name of the
variable is '__error_text__'.
I wanted to use it in order to do something like :
function bar()
...
if some_error_condition,
try error("bar") ;
catch
printf( __error_text__ ); ## Show the all the calling functions
end
keyboard
end
So that I could both know what the callig functions are, and also
inspect the local variables. Afaik, this is not currently possible;
am I right?
Cheers,
Etienne
# I don't manage to use the 'error_text' built-in variable :
#
# octave:100> function foo(), error("this function is broken");end
#
# octave:101> foo
#
# error: this function is broken
# error: called from `foo'
#
# octave:101> try foo();catch error_text end; error_text
# error_text =
# error_text =
#
# octave:102> help error_text
# error_text is a built-in constant
#
# the text of error messages that would have been printed in the
# body of the most recent unwind_protect statement or the TRY part of
# the most recent eval() command. Outside of unwind_protect and
# eval(), or if no error has ocurred within them, the value of
# __error_text__ is guaranteed to be the empty string.
#
# Does anyone see what I'm doing wrong?
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------