Skip to content

Commit

Permalink
FIX: (#145) 이미지도메인 예외 계층을 추가한다
Browse files Browse the repository at this point in the history
  • Loading branch information
anxi01 committed Feb 20, 2025
1 parent bc0911d commit d74b30f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/zerozero/image/exception/ImageErrorType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.zerozero.image.exception;

import com.zerozero.core.support.error.ErrorType;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;

@Getter
@RequiredArgsConstructor
public enum ImageErrorType implements ErrorType {
INVALID_IMAGE_PREFIX(HttpStatus.BAD_REQUEST, "유효하지 않은 prefix 값입니다."),
INVALID_IMAGE_EXTENSION(HttpStatus.BAD_REQUEST, "유효하지 않은 확장자입니다."),
FAILED_TO_MAKE_URL(HttpStatus.INTERNAL_SERVER_ERROR, "PreSigned URL 생성에 실패했습니다."),
;

private final HttpStatus status;

private final String message;
}
15 changes: 15 additions & 0 deletions src/main/java/com/zerozero/image/exception/ImageException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.zerozero.image.exception;

import com.zerozero.core.support.error.CoreException;
import com.zerozero.core.support.error.ErrorType;

public class ImageException extends CoreException {

public ImageException(ErrorType errorType) {
super(errorType);
}

public ImageException(ErrorType errorType, Object data) {
super(errorType, data);
}
}

0 comments on commit d74b30f

Please sign in to comment.