Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 18024
Status: resolved
Worked: 2 hours (120 min)
Left: 0 min
Priority: 0/0
Queue: Error

Owner: SHLOMIF <SHLOMIF [...] cpan.org>
Requestors: mr_e [...] aracnet.com
Cc:
AdminCc:

Severity: Important
Broken in: 0.15
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Mon Mar 06 20:50:49 2006 guest - Ticket created  
Subject: try does not handle errors that are references to objects that cannot "throw"
[text/plain 341b]
If Error::try catches an thrown exception that does not support "throw",
it breaks (such as APR::Error). I got around this by adding
UNIVERSAL::can and changing line 396:

throw $err if defined($err);

to:

if ( defined $err ) {
throw $err if $err->can('throw');
die $err; # perhaps there is a better alternative?
}


Ted

#   Thu Mar 30 12:20:42 2006 guest - Correspondence added  
From: Shlomi Fish
[text/plain 657b]
On Mon Mar 06 20:50:49 2006, guest wrote:
> If Error::try catches an thrown exception that does not support
"throw",
> it breaks (such as APR::Error). I got around this by adding
> UNIVERSAL::can and changing line 396:
>

This problem and a related one is fixed in my version of Error.pm that
can be found here:

svn://svn.berlios.de/web-cpan/Error.pm/trunk/module/

I added a test for it, as well.

Regards,

Shlomi Fish

> throw $err if defined($err);
>
> to:
>
> if ( defined $err ) {
> throw $err if $err->can('throw');
> die $err; # perhaps there is a better alternative?
> }
>
>
> Ted



#   Thu Mar 30 12:20:44 2006 RT_System - Status changed from 'new' to 'open'  
#   Fri Apr 07 08:10:40 2006 SHLOMIF - Status changed from 'open' to 'resolved'  
#   Fri Apr 07 08:10:42 2006 SHLOMIF - Given to SHLOMIF