Skip to content

Commit 905c23f

Browse files
authored
Merge pull request #190 from CSE-Shaco/develop
fix(user-admin): 에러 코드 디버깅
2 parents 831cf91 + 72b4a1f commit 905c23f

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/app/admin/member-manager/page.jsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,26 @@ export default function AdminUsersPage() {
8585
headers: {Accept: 'application/json'},
8686
});
8787

88-
if (!alive) return;
89-
90-
// 403이면 바로 discard
91-
if (res?.status === 403) {
92-
setCanRenderDelete(false);
93-
return;
94-
}
95-
9688
const okHttp = res?.status === 200 || res?.status === 204;
9789
const okBody = (res?.data?.code ?? 200) === 200;
9890

9991
setCanRenderDelete(okHttp && okBody);
100-
} catch {
92+
} catch (error) {
93+
// ---- 디버그용 상세 로그 ----
94+
const status = error?.response?.status;
95+
const statusText = error?.response?.statusText;
96+
const apiMessage = error?.response?.data?.message ?? error?.response?.data?.error ?? error?.message;
97+
const method = error?.config?.method?.toUpperCase?.();
98+
const url = error?.config?.url;
99+
100+
console.error('[auth LEAD check failed]', JSON.stringify({
101+
status,
102+
statusText,
103+
method,
104+
url,
105+
message: apiMessage
106+
}, null, 2));
107+
101108
if (alive) setCanRenderDelete(false);
102109
}
103110
})();

0 commit comments

Comments
 (0)