Convert PDOException to DBError in _fetch()

This commit is contained in:
Kijin Sung 2020-12-26 17:14:11 +09:00
parent 3dc27f37b7
commit afcc25bd50

View file

@ -477,6 +477,8 @@ class DB
return $stmt;
}
try
{
$result = array();
$index = $last_index;
$step = $last_index !== 0 ? -1 : 1;
@ -488,6 +490,11 @@ class DB
}
$stmt->closeCursor();
}
catch (\PDOException $e)
{
throw new Exceptions\DBError($e->getMessage(), 0, $e);
}
if ($result_type === 'auto' && $last_index === 0 && count($result) === 1)
{