Skip to content

Commit a6c0777

Browse files
committed
[Test]sentry error logging test
1 parent 0799ecf commit a6c0777

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies {
4242
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
4343
implementation 'org.springframework.boot:spring-boot-starter-web'
4444
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
45-
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:7.9.0'
45+
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:8.3.0'
4646
implementation 'javax.enterprise:cdi-api:2.0'
4747
developmentOnly 'org.springframework.boot:spring-boot-devtools'
4848
runtimeOnly 'org.postgresql:postgresql'

src/main/java/com/example/Jinus/controller/NoticeController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.text.ParseException;
1717
import java.util.*;
1818
import java.util.List;
19+
import io.sentry.Sentry;
1920

2021
@RestController
2122
public class NoticeController {
@@ -46,6 +47,12 @@ public NoticeController(
4647
// 학교 공지사항 조회
4748
@PostMapping("/api/spring/main-notice")
4849
public String getMainNotice() throws ParseException {
50+
try {
51+
throw new Exception("This is a test.");
52+
} catch (Exception e) {
53+
Sentry.captureException(e);
54+
}
55+
4956
int departmentId = 117; // 학교 공지사항 id
5057
String collegeEng = "etc"; // 단과대학 영문명
5158
String departmentEng = "main"; // 학과 영문명

src/main/java/com/example/Jinus/controller/v2/CafeteriaControllerV2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public String responseCafeteriaOrCampusListCard(@RequestBody RequestDto requestD
4545
// 사용자가 존재 & 식당 블록에서 캠퍼스 눌렀을 때 -> 식당 리스트
4646
if (campusId != -1 && sysCampusId != -1) {
4747
return cafeteriaServiceV2.makeCafeteriaListCard(campusId);
48-
} else { // 사용자가 존재 X & 식당 블록에서 더보기 버튼 눌렀을 때(-1 반환)-> 캠퍼스 리스트
48+
} else { // 사용자가 존재 X & 식당 블록에서 더보기 버튼 눌렀을 때 -> 캠퍼스 리스트
4949
return campusServiceV2.makeCampusListCard();
5050
}
5151
}

src/main/java/com/example/Jinus/service/v2/cafeteria/CafeteriaServiceV2.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.example.Jinus.dto.response.ButtonDto;
44
import com.example.Jinus.dto.response.ListItemDto;
55
import com.example.Jinus.dto.response.ResponseDto;
6-
import com.example.Jinus.repository.cafeteria.CafeteriaRepository;
76
import com.example.Jinus.repository.v2.cafeteria.CafeteriaRepositoryV2;
87
import com.example.Jinus.utility.JsonUtils;
98
import com.example.Jinus.utility.ListCardResponse;

0 commit comments

Comments
 (0)