Fix Sonar complains
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-app / src / main / java / org / o / ran / oam / nf / oam / adopter / app / controller / RestExceptionHandler.java
index 4eb1625..fff799a 100644 (file)
@@ -51,10 +51,11 @@ public class RestExceptionHandler {
     /**
      * Handle Not Found Exceptions.
      */
+    @ResponseStatus(HttpStatus.NOT_FOUND)
     @ExceptionHandler({NotFoundException.class})
-    public static ResponseEntity<Object> handleNotFoundExceptions(final NotFoundException exception) {
+    public static String handleNotFoundExceptions(final NotFoundException exception) {
         LOG.error("Request failed", exception);
-        return ResponseEntity.notFound().build();
+        return exception.getMessage();
     }
 
     /**