Package ai.docling.serve.api.validation
Class ValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.docling.serve.api.validation.ValidationException
- All Implemented Interfaces:
Serializable
Represents an exception that is thrown when validation errors occur.
This exception is designed to encapsulate structured validation error details
represented by a
ValidationError object. It can provide additional
context through an optional message and an optional cause.
It extends RuntimeException, making it an unchecked exception.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValidationException(@Nullable ValidationError validationError) Constructs a new ValidationException with the specified ValidationError.ValidationException(@Nullable ValidationError validationError, @Nullable String message) Constructs a new ValidationException with the specified ValidationError and message.ValidationException(@Nullable ValidationError validationError, @Nullable Throwable cause) Constructs a new ValidationException with the specified ValidationError and cause.ValidationException(@Nullable ValidationError validationError, @Nullable Throwable cause, @Nullable String message) Constructs a new ValidationException with the specified ValidationError, cause, and message. -
Method Summary
Modifier and TypeMethodDescription@Nullable ValidationErrorRetrieves theValidationErrorassociated with this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ValidationException
Constructs a new ValidationException with the specified ValidationError. This constructor allows the exception to encapsulate aValidationErrorobject for providing detailed information about the validation error that occurred. This instance does not include an additional custom message or cause.- Parameters:
validationError- theValidationErrorcontaining validation error details, or null if no specific validation error details are provided.
-
ValidationException
Constructs a new ValidationException with the specified ValidationError and cause. This constructor allows the exception to encapsulate aValidationErrorobject for providing detailed information about the validation error that occurred, along with an optional cause for contextual information about the exception's origin.- Parameters:
validationError- theValidationErrorcontaining validation error details, or null if no specific validation error details are provided.cause- theThrowablecause of this exception, or null if no underlying cause is to be associated with this exception.
-
ValidationException
Constructs a new ValidationException with the specified ValidationError and message. This constructor allows the exception to encapsulate aValidationErrorobject for providing detailed information about the validation error that occurred, along with an optional custom message describing the error context.- Parameters:
validationError- theValidationErrorcontaining validation error details, or null if no specific validation error details are provided.message- the custom message for the exception, or null if no custom message is to be associated with this exception.
-
ValidationException
public ValidationException(@Nullable ValidationError validationError, @Nullable Throwable cause, @Nullable String message) Constructs a new ValidationException with the specified ValidationError, cause, and message. This constructor allows the exception to encapsulate aValidationErrorobject for providing detailed information about the validation error that occurred, along with an optional cause and custom message for additional contextual details regarding the exception.- Parameters:
validationError- theValidationErrorcontaining validation error details, or null if no specific validation error details are provided.cause- theThrowablecause of this exception, or null if no underlying cause is to be associated with this exception.message- the custom message for the exception, or null if no custom message is to be associated with this exception.
-
-
Method Details
-
getValidationError
Retrieves theValidationErrorassociated with this exception. This method returns the encapsulatedValidationErrorthat contains detailed information about the validation error. If no specific validation error information is available, this method may return null.- Returns:
- the
ValidationErrorassociated with this exception, or null if no validation error details are provided.
-