Skip to content

Commit

Permalink
[feat] customException으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghee0820 committed Nov 14, 2024
1 parent 5e3fd2d commit 2aaed36
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import team7.inplace.admin.banner.application.dto.BannerInfo.Detail;
import team7.inplace.admin.banner.persistence.BannerRepository;
import team7.inplace.admin.banner.persistence.BannerS3Repository;
import team7.inplace.global.exception.InplaceException;
import team7.inplace.global.exception.code.BannerErrorCode;

@Service
@RequiredArgsConstructor
Expand All @@ -34,7 +36,7 @@ public List<Detail> getBanners() {

public void deleteBanner(Long id) {
var banner = bannerRepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("존재하지 않는 배너입니다."));
.orElseThrow(() -> InplaceException.of(BannerErrorCode.NOT_FOUND));
bannerS3Repository.deleteBanner(banner.getImgPath());
bannerRepository.delete(banner);
}
Expand Down

0 comments on commit 2aaed36

Please sign in to comment.