Browse Source

update error messages

Daniel Bohry 8 months ago
parent
commit
b00259f97a

+ 2 - 2
src/main/java/com/danielbohry/stocks/api/GlobalExceptionHandler.java

@@ -14,12 +14,12 @@ public class GlobalExceptionHandler {
 
     @ExceptionHandler(FeignException.NotFound.class)
     public ResponseEntity<Error> handleNotFoundException(FeignException e, WebRequest request) {
-        return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new Error(e.getMessage()));
+        return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new Error("Not found"));
     }
 
     @ExceptionHandler(FeignException.TooManyRequests.class)
     public ResponseEntity<Error> handleTooManyRequestsException(FeignException e, WebRequest request) {
-        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new Error(e.getMessage()));
+        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new Error("Too many requests"));
     }
 
 }