Package dyntabs.ai.extract
Class ExtractionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dyntabs.ai.extract.ExtractionException
- All Implemented Interfaces:
Serializable
Thrown when EasyAI cannot turn the source content into the requested type.
Analogy: like a NumberFormatException for AI extraction — the input
could not be coerced into the shape you asked for. It is unchecked so it does not clutter
call sites, but it carries a clear message and (where relevant) the model's raw output so
you can see what went wrong.
Raised by ExtractionBuilder.from(String) (and its overloads) in two
situations:
- the model never produced parseable JSON matching the target type, even after the configured retries;
.validate()was enabled and the extracted object failed Jakarta Bean Validation.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExtractionException(String message) Creates an exception with a human-readable message.ExtractionException(String message, Throwable cause) Creates an exception wrapping an underlying cause (e.g. a JSON parse error). -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ExtractionException
Creates an exception with a human-readable message.- Parameters:
message- what went wrong (and, where useful, the model's raw output)
-
ExtractionException
Creates an exception wrapping an underlying cause (e.g. a JSON parse error).- Parameters:
message- what went wrongcause- the underlying exception
-