diff --git a/pom.xml b/pom.xml
index 82819e2..923cdf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,14 @@
compile
+
+
+ io.sentry
+ sentry-spring-boot-starter-jakarta
+ 7.8.0
+ compile
+
+
org.springframework.boot
diff --git a/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java b/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java
index 5d9cc6e..69f8a45 100644
--- a/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java
+++ b/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java
@@ -2,6 +2,7 @@ package cc.fascinated.backend.exception;
import cc.fascinated.backend.model.response.ErrorResponse;
import io.micrometer.common.lang.NonNull;
+import io.sentry.Sentry;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
@@ -39,6 +40,7 @@ public final class ExceptionControllerAdvice {
}
if (status == null) { // Fallback to 500
status = HttpStatus.INTERNAL_SERVER_ERROR;
+ Sentry.captureException(ex); // Capture the exception
}
return new ResponseEntity<>(new ErrorResponse(status, message), status);
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index e952a7b..4e4cd5c 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -19,6 +19,11 @@ spring:
database: test
port: 27017
+# Sentry Configuration
+sentry:
+ dsn: ""
+ tracesSampleRate: 1.0
+
# Paste Configuration
paste:
# The length of the ID for the paste