fix: loadNotifications() 에러 내성 강화 - r.ok 체크 추가
배포 시 컨테이너 재시작으로 인한 502 응답이 JSON 파싱 실패를 일으키던 문제 방지. 에러 메시지도 "잠시 후 다시 시도해주세요"로 변경. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -174,7 +174,10 @@
|
||||
list.innerHTML = '<div style="padding:20px;text-align:center;color:#9CA3AF;font-size:13px;">로딩 중...</div>';
|
||||
|
||||
_authFetch(API_BASE + '/unread')
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (r) {
|
||||
if (!r.ok) throw new Error(r.status);
|
||||
return r.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
if (!data.success || !data.data || data.data.length === 0) {
|
||||
list.innerHTML = '<div style="padding:20px;text-align:center;color:#9CA3AF;font-size:13px;">새 알림이 없습니다</div>';
|
||||
@@ -217,7 +220,7 @@
|
||||
});
|
||||
})
|
||||
.catch(function () {
|
||||
list.innerHTML = '<div style="padding:20px;text-align:center;color:#EF4444;font-size:13px;">알림을 불러올 수 없습니다</div>';
|
||||
list.innerHTML = '<div style="padding:20px;text-align:center;color:#EF4444;font-size:13px;">잠시 후 다시 시도해주세요</div>';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user