We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c1456e1 + cf2c5b6 commit 65a951eCopy full SHA for 65a951e
src/main/java/com/getourguide/interview/error/ErrorHandler.java
@@ -0,0 +1,17 @@
1
+package com.getourguide.interview.error;
2
+
3
+import lombok.extern.slf4j.Slf4j;
4
+import org.springframework.http.ResponseEntity;
5
+import org.springframework.web.bind.annotation.ControllerAdvice;
6
+import org.springframework.web.bind.annotation.ExceptionHandler;
7
8
+@ControllerAdvice
9
+@Slf4j
10
+public class ErrorHandler {
11
12
+ @ExceptionHandler
13
+ public ResponseEntity<String> handleException(Exception e) {
14
+ log.error("An error occurred", e);
15
+ return ResponseEntity.status(500).body("Something went wrong");
16
+ }
17
+}
src/main/resources/static/favicon.ico
408 Bytes
0 commit comments