From: Justin Hunter Date: Sat, 22 Aug 2009 21:28:49 +0000 (-0700) Subject: break try catch into multiple lines X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d16840856b8e119502cfb7906ff7ed4969c79e48;p=dbsrgits%2FSQL-Translator-2.0-ish.git break try catch into multiple lines --- diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 1170ab5..711bca4 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -80,9 +80,14 @@ class SQL::Translator { method _build__producer { my $class = 'SQL::Translator::Producer'; my $role = $class . '::' . $self->producer; - + Class::MOP::load_class($class); - try { Class::MOP::load_class($role) } catch ($e) { warn "ERROR: $e"; $role = $class . '::SQL::' . $self->producer; Class::MOP::load_class($role) } + try { + Class::MOP::load_class($role) + } catch ($e) { + $role = $class . '::SQL::' . $self->producer; + Class::MOP::load_class($role) + } my $producer = $class->new({ translator => $self }); $role->meta->apply($producer); @@ -94,12 +99,13 @@ class SQL::Translator { if ($parser) { $self->_clear_parser; $self->parser($parser); - $self->schema($self->parse($data)); + $self->parse($data); + $self->schema; } elsif ($producer) { $self->_clear_producer; $self->schema($self->parse($data)) if $data; $self->producer($producer); - return $self->produce; + $self->produce; } }