[Bast-commits] r7842 -
DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed Nov 4 09:55:36 GMT 2009
Author: ribasushi
Date: 2009-11-04 09:55:35 +0000 (Wed, 04 Nov 2009)
New Revision: 7842
Modified:
DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm
Log:
Cleanup exceptions
Modified: DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-11-04 09:32:47 UTC (rev 7841)
+++ DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-11-04 09:55:35 UTC (rev 7842)
@@ -26,11 +26,11 @@
for my $col (@cols) {
my $seq = ( $source->column_info($col)->{sequence} ||= $self->dbh_do('_dbh_get_autoinc_seq', $source, $col) )
- or $self->throw_exception( "could not determine sequence for "
- . $source->name
- . ".$col, please consider adding a "
- . "schema-qualified sequence to its column info"
- );
+ or $self->throw_exception( sprintf(
+ 'could not determine sequence for column %s.%s, please consider adding a schema-qualified sequence to its column info',
+ $source->name,
+ $col,
+ ));
push @values, $self->_dbh_last_insert_id ($self->_dbh, $seq);
}
@@ -69,11 +69,14 @@
unless ( defined $seq_expr and $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i ) {
$seq_expr = '' unless defined $seq_expr;
$schema = "$schema." if defined $schema && length $schema;
- $self->throw_exception( "no sequence found for $schema$table.$col, check table definition, "
- . "or explicitly set the 'sequence' for this column in the "
- . $source->source_name
- . " class"
- );
+ $self->throw_exception( sprintf (
+ 'no sequence found for %s%s.%s, check the RDBMS table definition or explicitly set the '.
+ "'sequence' for this column in %s",
+ $schema ? "$schema." : '',
+ $table,
+ $col,
+ $source->source_name,
+ ));
}
return $1;
More information about the Bast-commits
mailing list