Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. package com.yobo.exceptions;
  2.  
  3. import org.springframework.http.HttpStatus;
  4. import org.springframework.http.ResponseEntity;
  5. import org.springframework.web.bind.annotation.ControllerAdvice;
  6. import org.springframework.web.bind.annotation.ExceptionHandler;
  7.  
  8. @ControllerAdvice
  9. public class GlobalExceptionHandling {
  10.  
  11. @ExceptionHandler(RequestException.class)
  12. public ResponseEntity<String> conflict(RequestException ex) {
  13. return new ResponseEntity<String>(ex.getMessage(), HttpStatus.BAD_REQUEST);
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement