소스 검색

update error messages

Daniel Bohry 8 달 전
부모
커밋
b00259f97a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/main/java/com/danielbohry/stocks/api/GlobalExceptionHandler.java

+ 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"));
     }
 
 }