Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.yobo.exceptions;
- import org.springframework.http.HttpStatus;
- import org.springframework.http.ResponseEntity;
- import org.springframework.web.bind.annotation.ControllerAdvice;
- import org.springframework.web.bind.annotation.ExceptionHandler;
- @ControllerAdvice
- public class GlobalExceptionHandling {
- @ExceptionHandler(RequestException.class)
- public ResponseEntity<String> conflict(RequestException ex) {
- return new ResponseEntity<String>(ex.getMessage(), HttpStatus.BAD_REQUEST);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement