[Catalyst-commits] r13830 - in Catalyst-Model-DBIC-Schema/trunk: . lib/Catalyst/Helper/Model/DBIC

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Thu Dec 9 21:06:51 GMT 2010


Author: caelum
Date: 2010-12-09 21:06:51 +0000 (Thu, 09 Dec 2010)
New Revision: 13830

Modified:
   Catalyst-Model-DBIC-Schema/trunk/Changes
   Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm
Log:
fix usage of Try::Tiny in helper

Modified: Catalyst-Model-DBIC-Schema/trunk/Changes
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/Changes	2010-12-09 05:56:54 UTC (rev 13829)
+++ Catalyst-Model-DBIC-Schema/trunk/Changes	2010-12-09 21:06:51 UTC (rev 13830)
@@ -1,5 +1,7 @@
 Revision history for Perl extension Catalyst::Model::DBIC::Schema
 
+        - fix usage of Try::Tiny in helper
+
 0.47  Wed Dec  8 22:21:06 UTC 2010
         - fix loader version check
 

Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2010-12-09 05:56:54 UTC (rev 13829)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2010-12-09 21:06:51 UTC (rev 13830)
@@ -439,7 +439,7 @@
         File::Spec->catfile($self->helper->{base}, 'lib', @schema_parts) . '.pm';
 
     if (not -f $schema_pm) {
-        try { Class::MOP::load_class('DBIx::Class::Schema::Loader') };
+        eval { Class::MOP::load_class('DBIx::Class::Schema::Loader') };
 
         return 'Result' if $@;
 
@@ -588,8 +588,12 @@
 
     my $schema_dir = File::Spec->catfile($helper->{base}, 'lib');
 
-    try { Class::MOP::load_class('DBIx::Class::Schema::Loader') };
-    die "Cannot load DBIx::Class::Schema::Loader: $@" if $@;
+    try {
+        Class::MOP::load_class('DBIx::Class::Schema::Loader')
+    }
+    catch {
+        die "Cannot load DBIx::Class::Schema::Loader: $_";
+    };
 
     DBIx::Class::Schema::Loader->import(
         "dump_to_dir:$schema_dir", 'make_schema_at'




More information about the Catalyst-commits mailing list