ValidationError

org.llm4s.error.ValidationError
See theValidationError companion object
final case class ValidationError extends LLMError, NonRecoverableError

Raised when the request parameters or inputs fail validation before being sent to the provider.

This is a NonRecoverableError: it indicates malformed requests, such as providing invalid parameters, missing required fields, or exceeding token limits in the input. The user must fix the request payload to resolve this error.

Value parameters

field

the name of the field that failed validation

message

human-readable description of the validation failure

violations

list of specific validation rules that were violated

Attributes

Companion
object
Graph
Supertypes
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def withViolation(violation: String): ValidationError
def withViolations(newViolations: List[String]): ValidationError

Inherited methods

def code: Option[String]

Optional error code for programmatic handling

Optional error code for programmatic handling

Attributes

Inherited from:
LLMError
def correlationId: Option[String]

Error correlation IDs for debugging

Error correlation IDs for debugging

Attributes

Inherited from:
LLMError
def formatted: String

Formatted error message with context

Formatted error message with context

Attributes

Inherited from:
LLMError
final override def isRecoverable: Boolean

DEPRECATED: Use type-level markers instead

DEPRECATED: Use type-level markers instead

Attributes

Definition Classes
Inherited from:
NonRecoverableError
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

override val context: Map[String, String]

Additional context information

Additional context information

Attributes