Skip to content

Instantly share code, notes, and snippets.

@LeoHeo
Created April 22, 2018 04:20
Show Gist options
  • Save LeoHeo/a7251d9b5fabd2b1ef506690ee8f785a to your computer and use it in GitHub Desktop.
Save LeoHeo/a7251d9b5fabd2b1ef506690ee8f785a to your computer and use it in GitHub Desktop.
@RestControllerAdvice
public class WebRestControllerAdvice {
/**
* 필수값이 안넘어왔을때 400 던지는 Custom Exception
*/
@ExceptionHandler(BadRequestException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public SimpleMessageDto invalidParameterException(BadRequestException ex) {
return new SimpleMessageDto("missing required value");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment