FIX: separate details exception
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user