com.vaadin.fusion.exception.
Class EndpointValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.vaadin.fusion.exception.EndpointException
-
- com.vaadin.fusion.exception.EndpointValidationException
-
All Implemented Interfaces:
public class EndpointValidationException extends EndpointException
A validation exception class that is intended to be thrown when any endpoint method receives invalid parameter(s). Behaves similar to the
EndpointException
and contains additional information about the validation errors.See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
EndpointValidationException.ValidationErrorData
A validation error data.
-
Field Summary
-
Fields inherited from class com.vaadin.fusion.exception.EndpointException
ERROR_MESSAGE_FIELD
-
-
Constructor Summary
Constructors Constructor and Description EndpointValidationException(EndpointValidationException.ValidationErrorData data)
Creates a validation exception from the error data.
EndpointValidationException(List<EndpointValidationException.ValidationErrorData> validationErrorData)
Creates a validation exception from a error data list.
EndpointValidationException(String message, List<EndpointValidationException.ValidationErrorData> validationErrorData)
Creates a validation exception from a error data list.
-
Method Summary
All Methods Modifier and Type Method and Description Map<String,Object>
getSerializationData()
Creates a map with the serialization data to be sent to the client when the exception thrown is processed by
VaadinConnectController
.List<EndpointValidationException.ValidationErrorData>
getValidationErrorData()
Gets the collection of the data on the validation errors.
-
Methods inherited from class com.vaadin.fusion.exception.EndpointException
getDetail
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
EndpointValidationException
public EndpointValidationException(EndpointValidationException.ValidationErrorData data)
Creates a validation exception from the error data.
Parameters:
data
- validation error data, mandatory (cannot benull
)
-
EndpointValidationException
public EndpointValidationException(List<EndpointValidationException.ValidationErrorData> validationErrorData)
Creates a validation exception from a error data list.
Parameters:
validationErrorData
- A list of validation error data, must not benull
or empty.
-
EndpointValidationException
public EndpointValidationException(String message, List<EndpointValidationException.ValidationErrorData> validationErrorData)
Creates a validation exception from a error data list.
Parameters:
message
- General error message.validationErrorData
- A list of validation error data, must not benull
or empty.
-
-
Method Detail
-
getValidationErrorData
public List<EndpointValidationException.ValidationErrorData> getValidationErrorData()
Gets the collection of the data on the validation errors.
Returns:
the error data
-
getSerializationData
public Map<String,Object> getSerializationData()
Description copied from class:
EndpointException
Creates a map with the serialization data to be sent to the client when the exception thrown is processed by
VaadinConnectController
. The following data will be sent to the client:- exception type: either the original exception type or
EndpointException
, if no original exception is given - message: non-blank message either from the constructor or from the original exception. If both are blank, none provided.
- detail: detail object serialized to json, if provided in the corresponding constructor
Overrides:
getSerializationData
in classEndpointException
Returns:
the data to be sent to the client
- exception type: either the original exception type or
-
-