diff --git a/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java b/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java index e3edbd69..299ce772 100644 --- a/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java +++ b/src/backend/chatting-server/src/main/java/chattingserver/controller/ChatController.java @@ -8,7 +8,6 @@ import chattingserver.service.ChatMessageService; import chattingserver.service.RoomService; //import chattingserver.util.constant.ErrorCode; -import chattingserver.util.exception.CustomAPIException; import com.lalala.exception.BusinessException; import com.lalala.exception.ErrorCode; import com.lalala.response.BaseResponse; diff --git a/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java b/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java deleted file mode 100644 index 5416560d..00000000 --- a/src/backend/chatting-server/src/main/java/chattingserver/util/constant/ErrorCode.java +++ /dev/null @@ -1,32 +0,0 @@ -package chattingserver.util.constant; - -import chattingserver.dto.response.CommonAPIError; -import lombok.Getter; - -import java.time.LocalDateTime; - -@Getter -public enum ErrorCode { - ROOM_NOT_FOUND_ERROR(4003, "CHATTING-001", "id에 해당하는 채팅방이 없습니다."); - - private final int status; - private final String code; - private final String description; - - ErrorCode(int status, String code, String description) { - this.status = status; - this.code = code; - this.description = description; - } - - public CommonAPIError toErrorResponseDto(String msg) { - return CommonAPIError - .builder() - .status(this.status) - .errorCode(this.code) - .description(this.description) - .errorMsg(msg) - .timestamp(LocalDateTime.now()) - .build(); - } -} diff --git a/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java b/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java deleted file mode 100644 index eeebffd8..00000000 --- a/src/backend/chatting-server/src/main/java/chattingserver/util/exception/CustomAPIException.java +++ /dev/null @@ -1,22 +0,0 @@ -package chattingserver.util.exception; - -import chattingserver.util.constant.ErrorCode; -import lombok.Getter; - -@Getter -public class CustomAPIException extends RuntimeException{ - - private static final long serialVersionUID = 1L; - - private final String description; - private final String code; - private final int status; - private String errorMsg; - - public CustomAPIException(ErrorCode errorCode, String errorMsg){ - this.description = errorCode.getDescription(); - this.status = errorCode.getStatus(); - this.code = errorCode.getCode(); - this.errorMsg = errorMsg; - } -} \ No newline at end of file