stas 2004/05/24 18:56:20
Modified: xs/APR/Error Error_pm . Changes Log: Exception error messages now include the error id along with the error message (as they did in first place). Revision Changes Path 1.2 +12 -4 modperl-2.0/xs/APR/Error/Error_pm Index: Error_pm =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/Error/Error_pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- Error_pm 4 May 2004 06:05:17 -0000 1.1 +++ Error_pm 25 May 2004 01:56:19 -0000 1.2 @@ -21,9 +21,17 @@ bless \%args, $class; } +# +# - even though the error id is not useful most of the time to the end +# users, developers may need to know it. For example in case of a +# non-english user locale setting, the error string could be +# incomprehensible to a developer, but by having the error id it's +# possible to find the english equivalent +# - the filename and line number are needed because perl doesn't +# provide that info when exception objects are involved sub str { - sprintf "%s: %s at %s line %d", $_[0]->{func}, - APR::Error::strerror($_[0]->{rc}), + sprintf "%s: (%d) %s at %s line %d", $_[0]->{func}, + $_[0]->{rc}, APR::Error::strerror($_[0]->{rc}), $_[0]->{file}, $_[0]->{line}; } @@ -38,7 +46,7 @@ # caller). sub cluck { if (ref $_[0] eq __PACKAGE__) { - Carp::cluck("$_[0]->{func}: " . + Carp::cluck("$_[0]->{func}: ($_[0]->{rc}) " . APR::Error::strerror($_[0]->{rc})); } else { @@ -48,7 +56,7 @@ sub confess { if (ref $_[0] eq __PACKAGE__) { - Carp::confess("$_[0]->{func}: " . + Carp::confess("$_[0]->{func}: ($_[0]->{rc}) " . APR::Error::strerror($_[0]->{rc})); } else { 1.380 +3 -0 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.379 retrieving revision 1.380 diff -u -u -r1.379 -r1.380 --- Changes 24 May 2004 19:56:51 -0000 1.379 +++ Changes 25 May 2004 01:56:19 -0000 1.380 @@ -12,6 +12,9 @@ =item 1.99_15-dev +Exception error messages now include the error id along with the error +message (as they did in first place). [Stas] + $r->finfo now accepts APR::Finfo object as an optional argument. [Stas]