Package com.moeen.shared_lib.exception
Class ValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.moeen.shared_lib.exception.ValidationException
- All Implemented Interfaces:
Serializable
Exception for programmatic validation errors that include field paths.
Use this when you need to report validation failures from service/business
logic with the same structured field-error format as
@Valid.
Usage examples:
// Single field
throw new ValidationException("email", "already taken");
// Multiple fields via builder
throw ValidationException.builder()
.field("startDate", "must be before endDate")
.field("endDate", "must be after startDate")
.build();
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionValidationException(String fieldPath, String message) ValidationException(Map<String, String> fieldErrors) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ValidationException
-
ValidationException
-
-
Method Details
-
getFieldErrors
-
builder
-