Hi

how can I get the variables I defined in the page in the error script ?
with cgi.tcl I used:

     foreach a [info var] {
      if {[catch {set _var [set ${a}]}]} {
           puts $ofd "$a [array get $a]"
      } elseif {![regexp "tcl" $_var]} {
           puts $ofd "$a $_var" 
      }
     }


Thanks

Yahalom Emet
Software Developer
Xor Technologies Ltd.

Tel: +972 (0)4-6619164
E-mail: [EMAIL PROTECTED]
Web: http://www.xortechnologies.com


----- Original Message ----- 
From: "David N. Welton" <[EMAIL PROTECTED]>
To: "yahalom emet" <[EMAIL PROTECTED]>
Cc: "Mod_dtcl" <[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 12:42 PM
Subject: Re: error script


> "yahalom emet" <[EMAIL PROTECTED]> writes:
> 
> > I added an ErrorScript to apache.I want this script to mail the
> > admin the error info and all variables cookies and local varibale
> > that where used in the script.
> 
> Interesting - if/when you get it working, it would be a nice snippet
> of code to share with the group.
> 
> > 1. how do I get the error?
> 
> This would be a good thing to include in the docs, I suppose:-) The
> variable is "errorInfo", which in all fairness, is a documented part
> of Tcl, but I suppose it would be a good thing to reiterate it in my
> docs.
> 
> Example:
> 
> tclsh8.3 [~]catch { boogy woogy }
> 1
> tclsh8.3 [~]puts $errorInfo 
> invalid command name "boogy"
>     while executing
> "boogy woogy "
> 
> > 2. it seems that VARS and ENVS and COOKIES does not exist in the
> > error script. also local variable that where created in the script
> > are not retrieved by a similiar scriot I used with tcl.cgi:
> 
> You have to access them like this:
> 
> ::request::VARS
> 
> ::request::ENVS
> 
> and so on.  This is because pages (at least .ttml) are run in the
> 'request' namespace, in order to keep things clean.  Another thing to
> put in the docs... thanks for asking about this stuff:-)
> 
> -- 
> David N. Welton
>    Consulting: http://www.dedasys.com/
> Free Software: http://people.debian.org/~davidw/
>    Apache Tcl: http://tcl.apache.org/
>      Personal: http://www.efn.org/~davidw/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to