카카오 지오코딩 호출을 try/catch로 감싼다.

- 외부(카카오) SDK 예외가 미처리 예외로 전파되어 콘솔 오염·
  DevTools "예외에서 일시중지"로 화면이 멈추는 것을 방지
- geocodeChain 호출 및 마커 생성 콜백을 방어적으로 보호

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
taekyoungc
2026-06-08 12:53:02 +09:00
parent 6b1c118651
commit 600a79788e

View File

@@ -115,6 +115,7 @@ $mapId = 'mainKakaoMap';
(function next(i) {
if (i >= tries.length) { cb(null); return; }
var mode = tries[i][0], q = tries[i][1];
try {
if (mode === 'addr') {
geocoder.addressSearch(q, function (result, status) {
if (status === kakao.maps.services.Status.OK && result && result[0]) {
@@ -128,6 +129,7 @@ $mapId = 'mainKakaoMap';
} else { next(i + 1); }
});
}
} catch (e) { cb(null); }
})(0);
}
@@ -165,6 +167,7 @@ $mapId = 'mainKakaoMap';
SHOPS.forEach(function (shop, idx) {
geocodeChain(shop, function (pos) {
pending--;
try {
if (pos) {
var marker = new kakao.maps.Marker({ position: pos, map: map });
markers[idx] = marker;
@@ -174,6 +177,7 @@ $mapId = 'mainKakaoMap';
var dot = document.querySelector('.shop-item[data-idx="' + idx + '"] .shop-dot');
if (dot) { dot.style.background = '#243a5e'; }
}
} catch (e) {}
if (pending === 0) done();
});
});