-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
119 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { HttpException, HttpStatus } from '@nestjs/common'; | ||
|
||
export class CustomException extends HttpException { | ||
constructor( | ||
private readonly _errorCode: string, | ||
message: string, | ||
status: HttpStatus, | ||
) { | ||
super( | ||
{ | ||
errorCode: _errorCode, | ||
message: message, | ||
}, | ||
status, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class UserNicknameResponseDto { | ||
constructor(public nickname: string) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
import { CustomException } from '../../global/common/customException'; | ||
|
||
export class UserNotFoundException extends CustomException { | ||
constructor() { | ||
super('U001', '해당 유저를 찾을 수 없습니다.', HttpStatus.NOT_FOUND); | ||
} | ||
} | ||
|
||
export class UserInvalidPasswordException extends CustomException { | ||
constructor() { | ||
super('U002', '비밀번호를 다시 확인해주세요.', HttpStatus.BAD_REQUEST); | ||
} | ||
} | ||
|
||
export class UserNicknameDuplicatedException extends CustomException { | ||
constructor() { | ||
super('U003', '해당 nickname는 사용 중입니다.', HttpStatus.CONFLICT); | ||
} | ||
} | ||
|
||
export class UserEmailDuplicatedException extends CustomException { | ||
constructor() { | ||
super('U004', '이미 해당 Email로 회원가입했습니다.', HttpStatus.CONFLICT); | ||
} | ||
} | ||
|
||
export class UserLoginRequiredException extends CustomException { | ||
constructor() { | ||
super('U005', '로그인이 필요합니다.', HttpStatus.UNAUTHORIZED); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters