Skip to content

Commit b69af6f

Browse files
committed
chore : API 로깅 강화
1 parent 6299cb7 commit b69af6f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

libs/util-config/src/apis/instance.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,17 @@ const reportServerError = async (
141141
? 'USER'
142142
: 'ADMISSION';
143143

144-
const requestPayload =
144+
const request =
145145
typeof config.data === 'string' ? config.data : JSON.stringify(config.data || {});
146146

147+
const response = error.response?.data
148+
? typeof error.response.data === 'string'
149+
? error.response.data
150+
: JSON.stringify(error.response.data)
151+
: 'NULL';
152+
153+
const requestPayload = `REQUEST: ${request} / RESPONSE: ${response}`;
154+
147155
// 에러 타입 분류
148156
let errorCategory = 'SERVER_ERROR';
149157
let errorCode = 'INTERNAL_SERVER_ERROR';

libs/util-config/src/meercat/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type PageType = 'AUTH' | 'USER' | 'ADMISSION';
1+
export type PageType = 'AUTH' | 'USER' | 'ADMISSION' | 'ADMISSION_SUBMIT';
22

33
export interface NetworkTest {
44
latency: number;

0 commit comments

Comments
 (0)