[Bast-commits] r7692 - in
DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx: .
Class/Storage Class/Storage/DBI
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Sep 18 12:36:30 GMT 2009
Author: ribasushi
Date: 2009-09-18 12:36:29 +0000 (Fri, 18 Sep 2009)
New Revision: 7692
Modified:
DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class.pm
DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI/Sybase.pm
Log:
Factor out dumper copy/paste
Modified: DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-09-18 12:32:15 UTC (rev 7691)
+++ DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI/Sybase.pm 2009-09-18 12:36:29 UTC (rev 7692)
@@ -696,18 +696,11 @@
$self->throw_exception("Unexpected populate error: $err")
if ($i > $#$tuple_status);
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
-
$self->throw_exception(sprintf "%s for populate slice:\n%s",
($tuple_status->[$i][1] || $err),
- Data::Dumper::Dumper(
- { map { $source_columns[$_] => $new_data[$i][$_] } (0 .. $#$cols) }
- ),
+ $self->_pretty_print ({
+ map { $source_columns[$_] => $new_data[$i][$_] } (0 .. $#$cols)
+ }),
);
}
@@ -849,15 +842,11 @@
my $sth = $cursor->sth;
if (not $sth) {
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
- croak "\nCould not find row in table '$table' for blob update:\n".
- Data::Dumper::Dumper(\%where)."\n";
+ $self->throw_exception(
+ "Could not find row in table '$table' for blob update:\n"
+ . $self->_pretty_print (\%where)
+ );
}
eval {
Modified: DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI.pm 2009-09-18 12:32:15 UTC (rev 7691)
+++ DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class/Storage/DBI.pm 2009-09-18 12:36:29 UTC (rev 7692)
@@ -1419,18 +1419,11 @@
$self->throw_exception("Unexpected populate error: $err")
if ($i > $#$tuple_status);
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
-
$self->throw_exception(sprintf "%s for populate slice:\n%s",
($tuple_status->[$i][1] || $err),
- Data::Dumper::Dumper(
- { map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols) }
- ),
+ $self->_pretty_print ({
+ map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols)
+ }),
);
}
Modified: DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class.pm 2009-09-18 12:32:15 UTC (rev 7691)
+++ DBIx-Class/0.08/branches/sybase_insert_bulk/lib/DBIx/Class.pm 2009-09-18 12:36:29 UTC (rev 7692)
@@ -75,7 +75,20 @@
sub _sqlt_minimum_version { $minimum_sqlt_version };
}
+# Pretty printer for debug messages
+sub _pretty_print {
+ require Data::Dumper;
+ local $Data::Dumper::Terse = 1;
+ local $Data::Dumper::Indent = 1;
+ local $Data::Dumper::Useqq = 1;
+ local $Data::Dumper::Quotekeys = 0;
+ local $Data::Dumper::Sortkeys = 1;
+
+ return Data::Dumper::Dumper ($_[1]);
+}
+
+
1;
=head1 NAME
More information about the Bast-commits
mailing list