Package com.vaadin.hilla.exception
Class EndpointValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.vaadin.hilla.exception.EndpointException
com.vaadin.hilla.exception.EndpointValidationException
- All Implemented Interfaces:
Serializable
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 ClassesModifier and TypeClassDescriptionstatic class
A validation error data. -
Field Summary
Fields inherited from class com.vaadin.hilla.exception.EndpointException
ERROR_MESSAGE_FIELD
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a validation exception from the error data.EndpointValidationException
(String message, List<EndpointValidationException.ValidationErrorData> validationErrorData) Creates a validation exception from a error data list.EndpointValidationException
(List<EndpointValidationException.ValidationErrorData> validationErrorData) Creates a validation exception from a error data list. -
Method Summary
Modifier and TypeMethodDescriptionCreates a map with the serialization data to be sent to the client when the exception thrown is processed byEndpointController
.Gets the collection of the data on the validation errors.Methods inherited from class com.vaadin.hilla.exception.EndpointException
getDetail
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EndpointValidationException
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 Details
-
getValidationErrorData
Gets the collection of the data on the validation errors.- Returns:
- the error data
-
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 byEndpointController
. 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
-