Re: suggestion for APR::Error docs
Torsten Förtsch <[email protected]> Wed, 22 Dec 2010 10:56:09 +0100
| Newsgroups | gmane.comp.apache.apreq |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday, December 21, 2010 23:47:42 Mark Hedges wrote:
> Seems to be some squirliness in this doc. Is this more clear? --mark--
>=20
To me the original version looks clearer. It says quite clearly "if I can=20
handle the exception do so else propagate".
However, the sigil before "ref" is certainly a typo. Also, I prefer "and"=20
instead of "&&" in such cases. But that's just me.
=46urther, ...
> --- /usr/lib/perl5/APR/Error.pm.orig 2010-12-21 14:42:28.000000000 -08=
00
> +++ /usr/lib/perl5/APR/Error.pm 2010-12-21 14:45:11.000000000 -0800
> @@ -109,13 +109,16 @@
> =3Dhead1 Synopsis
>=20
> eval { $obj->mp_method() };
> - if ($@ && $ref $@ eq 'APR::Error' && $@ =3D=3D $some_code) {
> - # handle the exception
> + if (my $err =3D $@) {
> + if (ref $err eq 'APR::Error') {
> + if ($err =3D=3D $apr_const_code) {
> + # handle exceptions for APR::Const codes...
> + }
what happens in the else branch here?
> + }
> + else {
> + die $err;
> + }
> }
> - else {
> - die $@; # rethrow it
> - }
> -
>=20
> =3Dhead1 Description
Torsten F=F6rtsch
=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)
Like fantasy? http://kabatinte.net