[FIX]ユーザー取得の例外処理を記述しました

This commit is contained in:
2026-09-17 16:36:43 +09:00
parent a7d61be450
commit f68a2569bd

View File

@@ -33,7 +33,9 @@ public class AnalysisServiceImpl implements AnalysisService {
public AnalysisModel getAnalysis(Long userId) {
// ユーザー情報取得、月別使用可能資金取得
UserEntity userEntity = userRepository.findById(userId).orElseThrow();
UserEntity userEntity = userRepository.findById(userId).orElseThrow(() ->
new RuntimeException(
"User not found."));
// コースID取得
Long courseId = userEntity.getCourseEntity().getCourseId();