Skip to content

Commit

Permalink
feat: 예방접종도우미 가입 회원이 아닌 경우 NOT_MEMBER 예외
Browse files Browse the repository at this point in the history
  • Loading branch information
HyungJu committed May 8, 2024
1 parent 5fe9e1f commit 5a5304d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/server/src/codef/validate-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function validateResponse<T extends CodefResponse<any>>(response: T): T {
case 'CF-00000':
return response;
case 'CF-12100':
if (response.result.message.includes('회원이 아닙니다'))
throw new DomainException(ErrorCode.NOT_MEMBER);
throw new CodefException<T>(response);
case 'CF-12800':
throw new DomainException(ErrorCode.ID_NOT_FOUND);
Expand Down
5 changes: 5 additions & 0 deletions apps/server/src/exception/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ export const ErrorCode = {
message: '본인인증이 제한되었습니다. 예방접종도우미에서 직접 처리해주세요.',
success: false,
},
NOT_MEMBER: {
code: 'NOT_MEMBER',
message: '예방접종도우미에 가입 되 어있지 않습니다.',
success: false,
},
};

0 comments on commit 5a5304d

Please sign in to comment.