use of com.odysseusinc.arachne.commons.api.v1.dto.ArachnePasswordInfoDTO in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ExceptionHandler(PasswordValidationException.class)
public ResponseEntity<JsonResult> exceptionHandler(PasswordValidationException ex) {
LOGGER.error("User tried to register with weak password");
JsonResult result = new JsonResult<>(VALIDATION_ERROR);
result.setErrorMessage("You have provided a weak password");
final ArachnePasswordInfoDTO passwordInfoDTO = conversionService.convert(ex.getPasswordInfo(), ArachnePasswordInfoDTO.class);
result.getValidatorErrors().put("password", passwordInfoDTO);
return new ResponseEntity<>(result, HttpStatus.OK);
}
Aggregations