File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ import { BadRequestException } from '@nestjs/common' ;
2+
3+ export class UserAlreadyInWorkspaceException extends BadRequestException {
4+ constructor ( ) {
5+ super ( '사용자가 이미 워크스페이스에 등록되어 있습니다.' ) ;
6+ }
7+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { WorkspaceNotFoundException } from '../exception/workspace.exception';
1010import { NotWorkspaceOwnerException } from '../exception/workspace-auth.exception' ;
1111import { TokenService } from '../auth/token/token.service' ;
1212import { ForbiddenAccessException } from '../exception/access.exception' ;
13+ import { UserAlreadyInWorkspaceException } from '../exception/role-duplicate.exception' ;
1314
1415enum MainWorkspace {
1516 OWNER_SNOWFLAKEID = 'admin' ,
@@ -38,7 +39,6 @@ export class WorkspaceService {
3839 }
3940 }
4041
41-
4242 async createWorkspace (
4343 userId : number ,
4444 dto : CreateWorkspaceDto ,
@@ -154,9 +154,8 @@ export class WorkspaceService {
154154 } ) ;
155155
156156 // 이미 워크스페이스에 등록된 경우
157- // TODO: 워크스페이스 관련 에러 구현
158157 if ( existingRole ) {
159- throw new Error ( '이미 워크스페이스에 가입된 사용자입니다.' ) ;
158+ throw new UserAlreadyInWorkspaceException ( ) ;
160159 }
161160
162161 // 새로운 역할 생성
@@ -205,7 +204,7 @@ export class WorkspaceService {
205204 // 권한이 없으면 예외 발생
206205 throw new ForbiddenAccessException ( ) ;
207206 }
208-
207+
209208 // 가장 처음에 모두가 접속할 수 있는 main workspace를 생성한다.
210209 async initializeMainWorkspace ( ) {
211210 let findOwner = await this . userRepository . findOneBy ( {
You can’t perform that action at this time.
0 commit comments