обработка ошибки

This commit is contained in:
2023-11-27 00:33:54 +06:00
parent 21335e4972
commit ffb9c31886

View File

@ -1112,12 +1112,16 @@
$expiration=false;
$overdue=false;
$sql="select * from ".$Schema."p__Login(".getSQLValue($idType,$_SESSION['USER_ID']).",'$login','$password',null,null,null);";
/*
$ga=new GoogleAuthenticator;
$code=$ga->getCode($user->ga_secret);
if ($code!=$_POST['code']) return new AuthError('invalid code');
*/
$res = $db->query($sql);
try
{
$res = $db->query($sql);
} catch (Exception $e)
{
if(str_contains($e->getMessage(), ']]'))
sendError(1, $e->getMessage());
else
sendError(1, '[['.trt("SQL_query_error").']]'.$e->getMessage());
}
if($res->rowCount()>0)
{
$result = $res->fetch(PDO::FETCH_ASSOC);