$dbicschema ||= $args->{'package'};
my $limit_sources = $args->{'sources'};
- die 'No DBIx::Class::Schema' unless ($dbicschema);
+ croak 'No DBIx::Class::Schema' unless ($dbicschema);
if (!ref $dbicschema) {
eval "use $dbicschema;";
- die "Can't load $dbicschema ($@)" if($@);
+ croak "Can't load $dbicschema ($@)" if($@);
}
my $schema = $tr->schema;
my @monikers = sort $dbicschema->sources;
if ($limit_sources) {
my $ref = ref $limit_sources || '';
- die "'sources' parameter must be an array or hash ref" unless $ref eq 'ARRAY' || ref eq 'HASH';
+ $dbicschema->throw_exception ("'sources' parameter must be an array or hash ref")
+ unless( $ref eq 'ARRAY' || ref eq 'HASH' );
# limit monikers to those specified in
my $sources;
if ($colinfo{is_nullable}) {
$colinfo{default} = '' unless exists $colinfo{default};
}
- my $f = $table->add_field(%colinfo) || die $table->error;
+ my $f = $table->add_field(%colinfo)
+ || $dbicschema->throw_exception ($table->error);
}
$table->primary_key($source->primary_columns);
name => $view_name,
fields => [ $source->columns ],
$source->view_definition ? ( 'sql' => $source->view_definition ) : ()
- ) || die $schema->error;
+ ) || $dbicschema->throw_exception ($schema->error);
$source->_invoke_sqlt_deploy_hook($view);
}
## Standalone
use MyApp::Schema;
use SQL::Translator;
-
+
my $schema = MyApp::Schema->connect;
my $trans = SQL::Translator->new (
parser => 'SQL::Translator::Parser::DBIx::Class',