FIX: separate details exception

This commit is contained in:
Juan Pablo Vial
2025-06-30 11:47:57 -04:00
parent 1fa152c07f
commit 5f4d8a4bc2

View File

@ -167,8 +167,13 @@ class Login
try {
$login = $this->repository->fetchActiveByUser($user->id);
$this->logout($login->user);
} catch (PDOException | EmptyResult $exception) {
error_log($exception.PHP_EOL, 3, '/logs/exception.log');
} catch (EmptyResult $exception) {
$message []= "No logins for user {$user->name}";
$message []= $exception->getMessage();
$message []= $exception->getTraceAsString();
error_log(implode(PHP_EOL, $message).PHP_EOL, 3, '/logs/login-exception.log');
} catch (PDOException $exception) {
error_log($exception.PHP_EOL, 3, '/logs/login-exception.log');
}
try {
@ -185,7 +190,7 @@ class Login
$this->saveCookie($selector, $token, $login->dateTime->add(new DateInterval("PT{$this->max_login_time}H")));
return true;
} catch (PDOException | Exception $exception) {
error_log($exception.PHP_EOL, 3, '/logs/exception.log');
error_log($exception.PHP_EOL, 3, '/logs/login-exception.log');
return false;
}
}