DomainError

class DomainError(message: String? = null, cause: Throwable? = null, contexts: Array<ExecutionContext>, val expectedDomain: DomainError.Expected, val culprit: Term, extraData: Term? = null) : LogicError

The domain error occurs when something has the correct type but the value is not admissible

Parameters

message

the detail message string.

cause

the cause of this exception.

contexts

a stack of contexts localising the exception

expectedDomain

The expected domain, that wouldn't have raised the error

culprit

The value not respecting expectedDomain

extraData

The possible extra data to be carried with the error

Constructors

Link copied to clipboard
constructor(message: String? = null, cause: Throwable? = null, contexts: Array<ExecutionContext>, expectedDomain: DomainError.Expected, culprit: Term, extraData: Term? = null)
constructor(message: String? = null, cause: Throwable? = null, context: ExecutionContext, expectedDomain: DomainError.Expected, actualValue: Term, extraData: Term? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

A class describing the expected domain whose absence caused the error

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The error Struct as described in Prolog standard: error(error_type, error_extra)

Link copied to clipboard
Link copied to clipboard
open val extraData: Term?
Link copied to clipboard

The exception stacktrace; shorthand for context.prologStackTrace

Link copied to clipboard
expect open val message: String?
Link copied to clipboard
open override val type: Struct

Functions

Link copied to clipboard
open override fun pushContext(newContext: ExecutionContext): DomainError
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun updateContext(newContext: ExecutionContext, index: Int = 0): DomainError

Creates a new exception instance with the context with in position index updated to newContext. Subclasses should override this method and return the correct instance.

Link copied to clipboard
open override fun updateLastContext(newContext: ExecutionContext): DomainError