|
Re: looking for source of a caught runtime error. [message #42962 is a reply to message #42951] |
Mon, 07 March 2005 08:39  |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
JeremyFaden@gmail.com wrote:
> I'd like to know the location of where a caught
> runtime error occurred. I use "catch, err" to catch any sort
> of runtime error during processing, and then
> throw up a dialog box indicating the error by using !error_state.
> Oddly, !error_state doesn't contain the line number within
> the source code where the error occurred. I feel like I'm missing
> something obvious, but I don't see anything in the documention
> regarding this.
>
Instead of your dialog box, use David's error_message function with the
/traceback keyword set:
http://www.dfanning.com/documents/programs.html#ERROR_MESSAG E
catch, err
IF err NE 0 THEN BEGIN
catch, /cancel
ok = error_message(/traceback, /error)
return
ENDIF
|
|
|