fix: 세션 만료 예외를 슬랙 알림에서 제외

- '회원정보 정보 없음' AuthenticationException은 API Key 검증 통과 후 발생하므로 세션 만료 정상 케이스
- IP 기반 필터링(EXCEPTION_IGNORED_IPS) 대신 예외 자체를 무조건 제외하도록 단순화

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 21:14:48 +09:00
parent 13ba753b7f
commit 0345ddcce3

View File

@@ -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;