my ( $self, $job, $workload ) = @_;
my $sth = $self->dbh->prepare($workload);
- my $rows = $sth->execute;
+ my $rows = eval { $sth->execute };
+ return { error => $@ } if $@;
warn "# $rows rows get_username_table $workload\n";
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 7;
use Data::Dump qw(dump);
use lib 'lib';
ok my $r = $o->sql('job', "select rtt from ping where username='nobody'"), 'sql';
diag dump($r);
+
+ok my $r = $o->sql('job', "select xx from fake"), 'sql with error';
+ok exists $r->{error}, 'error';
+diag dump($r);