Added more error checking to unconditionalRead so the page doesn't die on invalid SQL
This commit is contained in:
parent
eed58af22d
commit
e814dd106c
1 changed files with 4 additions and 2 deletions
|
|
@ -596,8 +596,10 @@ sub unconditionalRead {
|
|||
my ($sth,$dbh);
|
||||
$dbh = $_[2] || $WebGUI::Session::session{dbh};
|
||||
$sth = $dbh->prepare($_[1]) or WebGUI::ErrorHandler::warn("Unconditional read failed: ".$_[1]." : ".DBI->errstr);
|
||||
$sth->execute or WebGUI::ErrorHandler::warn("Unconditional read failed: ".$_[1]." : ".DBI->errstr);
|
||||
bless ({_sth => $sth}, $_[0]);
|
||||
if ($sth) {
|
||||
$sth->execute or WebGUI::ErrorHandler::warn("Unconditional read failed: ".$_[1]." : ".DBI->errstr);
|
||||
bless ({_sth => $sth}, $_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue