Skip to content

Commit 95ee0e2

Browse files
committed
Fixed cursor rule
1 parent 75d1d49 commit 95ee0e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.cursor/rules/302-frameworks-spring-boot-rest.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ public class ProblemDetailsExceptionHandler {
672672
logger.error("Internal server error with ID: {}",
673673
problemDetail.getProperties().get("errorId"), ex);
674674

675-
return ResponseEntity.of(problemDetail).build();
675+
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(problemDetail);
676676
}
677677

678678
@ExceptionHandler(EntityNotFoundException.class)
@@ -688,7 +688,7 @@ public class ProblemDetailsExceptionHandler {
688688
problemDetail.setInstance(URI.create(request.getRequestURI()));
689689
problemDetail.setProperty("timestamp", Instant.now());
690690

691-
return ResponseEntity.of(problemDetail).build();
691+
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(problemDetail);
692692
}
693693

694694
@ExceptionHandler(ValidationException.class)
@@ -705,7 +705,7 @@ public class ProblemDetailsExceptionHandler {
705705
problemDetail.setProperty("timestamp", Instant.now());
706706
problemDetail.setProperty("violations", ex.getViolations());
707707

708-
return ResponseEntity.of(problemDetail).build();
708+
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(problemDetail);
709709
}
710710
}
711711

0 commit comments

Comments
 (0)