Skip to content

Commit

Permalink
Disable the RaiseError on the DBH, use HandleError
Browse files Browse the repository at this point in the history
  • Loading branch information
reyjrar committed Dec 21, 2012
1 parent 815331a commit ffee39b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
7 changes: 6 additions & 1 deletion bin/dnsmon_sniffer.pl
Expand Up @@ -80,7 +80,12 @@ sub POE::Kernel::ASSERT_DEFAULT () { 1 }
if( exists $CFG->{db} && ref $CFG->{db} eq 'HASH' ) {
try {
$dbConn = DBIx::Connector->new( $CFG->{db}{dsn}, $CFG->{db}{user}, $CFG->{db}{pass},
{ RaiseError => 1 }
{
RaiseError => 0,
HandleError => sub {
$poe_kernel->post( 'log' => debug => shift );
}
}
);
};
}
Expand Down
25 changes: 15 additions & 10 deletions lib/POE/Component/dns/monitor/sniffer/plugin/packet/store.pm
Expand Up @@ -132,16 +132,21 @@ sub process {
next unless defined $data{value} && length $data{value};
$heap->{sth}{answer}->execute(
$response_id,
$set->{name},
$pa->ttl,
$pa->class,
$pa->type,
$pa->name,
$data{value},
$data{opts},
);
try {
my $rc = $heap->{sth}{answer}->execute(
$response_id,
$set->{name},
$pa->ttl,
$pa->class,
$pa->type,
$pa->name,
$data{value},
$data{opts},
);
die "error" unless $rc;
} catch {
$kernel->post( $heap->{log} => error => 'Failed to store details for [' . join(' ', $pa->class, $pa->type, $pa->name, $pa->ttl) . "] as $data{value}");
};
}
}
}
Expand Down

0 comments on commit ffee39b

Please sign in to comment.