Skip to content

Commit 67ab02d

Browse files
committed
refactor: dashboardClinet 에러메시지 변경
1 parent fc53d20 commit 67ab02d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/middleware/errorHandle.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ export const errorHandle = (err: Error, req: Request, res: Response, next: NextF
55
if (res.headersSent) {
66
return next(err);
77
}
8-
if (
9-
err.message === '등록된 유저가 아닙니다.' ||
10-
err.message === '비밀번호가 올바르지 않습니다.' ||
11-
err.message === 'apiKey가 유효하지 않습니다'
12-
) {
8+
if (err.message === '로그인 에러' || err.message === 'apiKey 인증실패') {
139
res.status(401).json({ message: err.message });
1410
}
1511

src/services/apiKeyService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function getClientDomain(apiKey: string) {
99
raw: true,
1010
});
1111
if (!clientDomain) {
12-
throw new Error('apiKey가 유효하지 않습니다');
12+
throw new Error('apiKey 인증에러');
1313
}
1414

1515
return clientDomain;

0 commit comments

Comments
 (0)