Conversion of eval => try (part 1)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class.pm
index 2a71a98..7aba895 100644 (file)
@@ -11,6 +11,7 @@ use DBIx::Class::Optional::Dependencies;
 use vars qw($VERSION);
 use base qw/DBIx::Class::Componentised Class::Accessor::Grouped/;
 use DBIx::Class::StartupCheck;
+use Try::Tiny;
 
 sub mk_classdata {
   shift->mk_classaccessor(@_);
@@ -27,7 +28,7 @@ sub component_base_class { 'DBIx::Class' }
 # Always remember to do all digits for the version even if they're 0
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
-$VERSION = '0.08120_1';
+$VERSION = '0.08121_01';
 
 $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
 
@@ -42,8 +43,14 @@ sub MODIFY_CODE_ATTRIBUTES {
 sub _attr_cache {
   my $self = shift;
   my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
-  my $rest = eval { $self->next::method };
-  return $@ ? $cache : { %$cache, %$rest };
+  my $rest;
+  my $exception;
+  try {
+    $rest = $self->next::method;
+  } catch {
+    $exception = 1;
+  };
+  return $exception ? $cache : { %$cache, %$rest };
 }
 
 1;
@@ -218,10 +225,12 @@ is traditional :)
 
 =head1 CONTRIBUTORS
 
-abraxxa: Alexander Hartmaier <alex_hartmaier@hotmail.com>
+abraxxa: Alexander Hartmaier <abraxxa@cpan.org>
 
 aherzog: Adam Herzog <adam@herzogdesigns.com>
 
+amoore: Andrew Moore <amoore@cpan.org>
+
 andyg: Andy Grundman <andy@hybridized.org>
 
 ank: Andres Kievsky
@@ -274,6 +283,8 @@ gphat: Cory G Watson <gphat@cpan.org>
 
 groditi: Guillermo Roditi <groditi@cpan.org>
 
+hobbs: Andrew Rodland <arodland@cpan.org>
+
 ilmari: Dagfinn Ilmari MannsE<aring>ker <ilmari@ilmari.org>
 
 jasonmay: Jason May <jason.a.may@gmail.com>
@@ -380,6 +391,8 @@ wreis: Wallace Reis <wreis@cpan.org>
 
 zamolxes: Bogdan Lucaciu <bogdan@wiz.ro>
 
+Possum: Daniel LeWarne <possum@cpan.org>
+
 =head1 COPYRIGHT
 
 Copyright (c) 2005 - 2010 the DBIx::Class L</AUTHOR> and L</CONTRIBUTORS>