com.clearlydecoded.messenger.exception.ValidationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-messenger Show documentation
Show all versions of rest-messenger Show documentation
Easily create and expose a Spring REST-based API implementation, without losing strong Java
message typing, improving simplicity and robustness of your implementations. It's so easy
to use, you can start implementing your production APIs in under 5 minutes.
package com.clearlydecoded.messenger.exception;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
* {@link ValidationException} class is an exception that contains more detail about particular
* fields that fails validation. It is intended to be used in the host app to return custom error
* messages (if the app so chooses) and thus enabling the client of the host app to dynamically map
* error messages to the particular fields that generated those validation errors.
*
* This exception triggers HTTP 400 Bad Request.
*
*/
@ResponseStatus(HttpStatus.BAD_REQUEST)
@Getter
@Setter
public class ValidationException extends RuntimeException {
/**
* List of error info. Each error info contains error message and the name of the field that was
* validated.
*/
private List errors;
/**
* General message that combines all the error messages from the errors
.
*/
private String message;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy