Skip Menu |

This queue is for tickets about the Error CPAN distribution.

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

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

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



Subject: try does not handle errors that are references to objects that cannot "throw"
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
From: Shlomi Fish
On Mon Mar 06 20:50:49 2006, guest wrote: Show quoted text
> If Error::try catches an thrown exception that does not support
"throw", Show quoted text
> 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 Show quoted text
> throw $err if defined($err); > > to: > > if ( defined $err ) { > throw $err if $err->can('throw'); > die $err; # perhaps there is a better alternative? > } > > > Ted