Skip to content

Commit

Permalink
[FEAT] S3Service에 ExternalException 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sung-silver committed Dec 23, 2024
1 parent b119b61 commit b41ad7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@RequiredArgsConstructor
@Getter
public enum ExternalFailureCode implements FailureCode {
FAIL_FOUND_S3_RESOURCE(NOT_FOUND, "S3에서 객체를 찾지 못했습니다");
NOT_FOUND_S3_RESOURCE(NOT_FOUND, "S3에서 객체를 찾지 못했습니다");

private final HttpStatus status;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.sopt.makers.operation.client.s3;

import static org.sopt.makers.operation.code.failure.BannerFailureCode.NOT_FOUND_BANNER_IMAGE;
import static org.sopt.makers.operation.code.failure.ExternalFailureCode.NOT_FOUND_S3_RESOURCE;

import java.time.Duration;

Expand Down Expand Up @@ -42,7 +42,7 @@ public String getUrl(String bucketName, String fileName) {
try {
return s3Client.utilities().getUrl(b -> b.bucket(bucketName).key(fileName)).toExternalForm();
} catch(NoSuchKeyException e) {
throw new BannerException(NOT_FOUND_BANNER_IMAGE);
throw new ExternalException(NOT_FOUND_S3_RESOURCE);
}
}

Expand Down

0 comments on commit b41ad7a

Please sign in to comment.