Skip to content

Commit

Permalink
refactor: 예외 메시지 구체화 및 상태 코드 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
BurningFalls committed Jul 24, 2024
1 parent 8ce7c06 commit 9de185c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.staccato.exception.StaccatoException;
import com.staccato.pin.domain.Pin;
import com.staccato.pin.repository.PinRepository;
import com.staccato.travel.domain.Travel;
Expand Down Expand Up @@ -57,11 +58,11 @@ private List<VisitImage> makeVisitImages(List<String> visitedImages, Visit visit

private Pin getPinById(long pinId) {
return pinRepository.findById(pinId)
.orElseThrow(() -> new IllegalArgumentException("Invalid Operation"));
.orElseThrow(() -> new StaccatoException("요청하신 핀을 찾을 수 없어요."));
}

private Travel getTravelById(long travelId) {
return travelRepository.findById(travelId)
.orElseThrow(() -> new IllegalArgumentException("Invalid Operation"));
.orElseThrow(() -> new StaccatoException("요청하신 여행을 찾을 수 없어요."));
}
}

0 comments on commit 9de185c

Please sign in to comment.