- Timestamp:
- 04/28/25 14:21:17 (3 weeks ago)
- Branches:
- main
- Children:
- e15e8d9
- Parents:
- f5b256e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/rezevirajmasa/demo/config/RestExceptionHandler.java
rf5b256e rdeea3c4 3 3 import com.example.rezevirajmasa.demo.dto.ErrorDto; 4 4 import com.example.rezevirajmasa.demo.model.exceptions.AppException; 5 import org.springframework.http.HttpStatus; 5 6 import org.springframework.http.ResponseEntity; 7 import org.springframework.http.converter.HttpMessageNotWritableException; 6 8 import org.springframework.web.bind.annotation.ControllerAdvice; 7 9 import org.springframework.web.bind.annotation.ExceptionHandler; … … 16 18 .body(ErrorDto.builder().message(ex.getMessage()).build()); 17 19 } 20 21 @ExceptionHandler(HttpMessageNotWritableException.class) 22 public ResponseEntity<String> handleHttpMessageNotWritableException(HttpMessageNotWritableException ex) { 23 return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("An error occurred while processing the response."); 24 } 18 25 }
Note:
See TracChangeset
for help on using the changeset viewer.