You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by David Kaufman <dk...@nac.net> on 2002/04/12 22:09:30 UTC
Fw: Registry.pm patch to mod_perl 1.26 (re: "error-notes" support)
Forwarded from modperl@apache.org general discussion list:
I'll vote for his too :-)
David Kaufman <dk...@vm.com>
Vanguard Media Corp
(212) 242-5317 Ext 125
----- Original Message -----
From: "Jesse Erlbaum" <je...@VM.COM>
To: "'Doug MacEachern'" <do...@covalent.net>; <mo...@apache.org>
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
jesse@vm.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org