Example #1
0
 @ExceptionHandler(ValidationException.class)
 @ResponseBody
 public ErrorMessageDto validationError(ValidationException validationException) {
   logger.error("Validation Exception : ", validationException);
   ErrorMessageDto errorMessageDto = new ErrorMessageDto();
   errorMessageDto.setMessage(validationException.getMessage());
   return errorMessageDto;
 }
Example #2
0
 @ExceptionHandler(Exception.class)
 @ResponseBody
 public ErrorMessageDto AnyOtherError(Exception exception) {
   logger.error("Internal Exception : ", exception);
   ErrorMessageDto errorMessageDto = new ErrorMessageDto();
   errorMessageDto.setMessage(exception.getMessage());
   return errorMessageDto;
 }
Example #3
0
 @ExceptionHandler(ApplicationException.class)
 @ResponseBody
 public ErrorMessageDto applicationError(ApplicationException applicationException) {
   logger.error("Application Exception : ", applicationException);
   ErrorMessageDto errorMessageDto = new ErrorMessageDto();
   errorMessageDto.setMessage(applicationException.getMessage());
   return errorMessageDto;
 }