diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 83bdeef..03e127a 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -17,25 +17,13 @@ class Handler extends ExceptionHandler { /** - * 특정 IP에서 발생하는 예외를 슬랙/로그에서 무시할지 확인 + * 슬랙 알림에서 무시할 예외인지 확인 */ protected function shouldIgnoreException(Throwable $e): bool { - $ignoredIps = array_filter( - array_map('trim', explode(',', env('EXCEPTION_IGNORED_IPS', ''))) - ); - - if (empty($ignoredIps)) { - return false; - } - - $currentIp = request()?->ip(); - - // 무시할 IP 목록에 있고, '회원정보 정보 없음' 예외인 경우 - if (in_array($currentIp, $ignoredIps, true)) { - if ($e instanceof AuthenticationException && $e->getMessage() === '회원정보 정보 없음') { - return true; - } + // 세션 만료로 인한 인증 실패는 슬랙 알림 제외 (API Key 검증 통과 후 발생하므로 정상 케이스) + if ($e instanceof AuthenticationException && $e->getMessage() === '회원정보 정보 없음') { + return true; } return false;