Error struct for general evaluation errors in Predicator evaluation.
This error occurs for runtime evaluation problems like division by zero, function call errors, or insufficient operands.
Fields
message- Human-readable error descriptionreason- Structured reason code for the erroroperation- The operation that failed (optional)position-{line, column}of the source token that produced the failing instruction, when a position table was available (optional)
Examples
%Predicator.Errors.EvaluationError{
message: "Division by zero",
reason: "division_by_zero",
operation: :divide
}
%Predicator.Errors.EvaluationError{
message: "Function len() expects 1 arguments, got 0",
reason: "insufficient_arguments",
operation: :function_call
}
Summary
Types
@type t() :: %Predicator.Errors.EvaluationError{ message: binary(), operation: atom() | nil, position: Predicator.Types.position() | nil, reason: binary() }