Untitled

mail@pastecode.io avatar
unknown
java
6 months ago
498 B
4
Indexable
Never
  @ExceptionHandler(DuplicatedEmailException.class)
    public ResponseEntity<ProjectResponse> handleException(DuplicatedEmailException ex) {
        return ResponseEntity.badRequest().body(new ProjectResponse(ex.getMessage()));
    }
//........................
 @ExceptionHandler(DuplicatedEmailException.class)
    public ResponseEntity<String> handleException(DuplicatedEmailException ex) {
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Email already exists");
    }
Leave a Comment