Forwarded from [EMAIL PROTECTED] general discussion list:
I'll vote for his too :-)
David Kaufman <[EMAIL PROTECTED]>
Vanguard Media Corp
(212) 242-5317 Ext 125
----- Original Message -----
From: "Jesse Erlbaum" <[EMAIL PROTECTED]>
To: "'Doug MacEachern'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 11:23 AM
Subject: Patch to mod_perl 1.26: "error-notes" support
Hello Doug & All --
One of my programmers (Dave Kaufman) brought to my attention a small but
useful feature which is present in mod_cgi, but missing from
Apache::Registry. When running via mod_cgi, if execution of a CGI
application fails, an error message will be propagated to an environment
variable, "ERROR_NOTES". This environment variable can be used by a custom
"ErrorDocument" to assist in quality assurance.
This variable is actually propagated, by http_request.c (confirmed in Apache
1.3.20), from an Apache "note" whose key is "error-notes". A number of
Apache handlers use the "error-notes" attribute to pass along human-readable
exception data.
Following is a patch I wrote (against mod_perl 1.26, Apache::Registry
version 2.01) which causes Apache::Registry to participate in this scheme.
I hope you find it sufficiently useful to include in the next version of
mod_perl.
Warmest regards,
-Jesse-
----START PATCH---->
diff -c -r1.1 Registry.pm
*** modules/i686-linux/Apache/Registry.pm 13 Mar 2002 18:06:34 -0000
1.1
--- modules/i686-linux/Apache/Registry.pm 22 Mar 2002 22:19:10 -0000
***************
*** 129,134 ****
--- 129,135 ----
if ($@) {
$r->log_error($@);
$@{$uri} = $@;
+ $r->notes('error-notes', $@);
return SERVER_ERROR unless $Debug && $Debug & 2;
return Apache::Debug::dump($r, SERVER_ERROR);
}
***************
*** 153,158 ****
--- 154,160 ----
if($errsv) {
$r->log_error($errsv);
+ $r->notes('error-notes', $errsv);
return SERVER_ERROR unless $Debug && $Debug & 2;
return Apache::Debug::dump($r, SERVER_ERROR);
}
<----END PATCH----
Jesse Erlbaum, CTO
Vanguard Media
http://www.vm.com
212.242.5317 x115
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]