[plt-scheme] Development and Debugging

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Sat Dec 17 05:11:26 EST 2005


--- "David J. Neu" <djneu at att.net> wrote:

> In general I agree, but sometimes we do make mitsakes or
> omissios in
> application code, or in tests and therefore would like to
> be able to
> identify the location of an error in the production
> system.

I admit my suggestion wasn't very helpful (at least in the
short term).  Here is, I hope, a better one:

You said you're using CGIs.  Therefore the programs cannot
contain any state -- they are pure functions of: the HTTP
request (including cookies, parameters etc.), and any
external resources (database, filesystem, etc.) [and maybe
the random number seed etc. but you get what I mean].  So
logging these relatively few items should be sufficient to
reconstruct any sequence of execution.  Let's refer to
these items as the CGI arguments.

Hence: stash the CGI arguments away in a parameter, and
install a custom error handler that dumps the CGI arguments
on failure.  Then inject the CGI arguments into a
error-traced version of your code to get better error
localisation.  This can be done offline where execution
time is not so critical.

HTH,
Noel

Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.