Package com.sequenceiq.cloudbreak.controller.json

Examples of com.sequenceiq.cloudbreak.controller.json.ValidationResult


    @ExceptionHandler({ MethodArgumentNotValidException.class })
    public ResponseEntity<ValidationResult> validationFailed(MethodArgumentNotValidException e) {
        MDCBuilder.buildMdcContext();
        LOGGER.error(e.getMessage(), e);
        ValidationResult result = new ValidationResult();
        for (FieldError err : e.getBindingResult().getFieldErrors()) {
            result.addValidationError(err.getField(), err.getDefaultMessage());
        }
        return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.controller.json.ValidationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.