DomainError

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

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

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

Types

Companion
Link copied to clipboard
common
object Companion
Expected
Link copied to clipboard
common
enum Expected : Enum<DomainError.Expected> , ToTermConvertible
A class describing the expected domain whose absence caused the error

Functions

pushContext
Link copied to clipboard
common
open override fun pushContext(newContext: ExecutionContext): DomainError
toString
Link copied to clipboard
common
open override fun toString(): String
updateContext
Link copied to clipboard
common
open override fun updateContext(newContext: ExecutionContext, index: Int): DomainError
Creates a new exception instance with the context with in position index updated to newContext.
updateLastContext
Link copied to clipboard
common
open override fun updateLastContext(newContext: ExecutionContext): DomainError

Properties

cause
Link copied to clipboard
common
open override val cause: Throwable?
context
Link copied to clipboard
common
val context: ExecutionContext
contexts
Link copied to clipboard
common
val contexts: Array<ExecutionContext>
a stack of contexts localising the exception
culprit
Link copied to clipboard
common
val culprit: Term
The value not respecting expectedDomain
errorStruct
Link copied to clipboard
common
val errorStruct: Struct
The error Struct as described in Prolog standard: error(error_type, error_extra)
expectedDomain
Link copied to clipboard
common
val expectedDomain: DomainError.Expected
The expected domain, that wouldn't have raised the error
extraData
Link copied to clipboard
common
open val extraData: Term? = null
The possible extra data to be carried with the error
message
Link copied to clipboard
common
open override val message: String?
prologStackTrace
Link copied to clipboard
common
val prologStackTrace: List<Struct>
The exception stacktrace; shorthand for context.prologStackTrace
type
Link copied to clipboard
common
open override val type: Struct
The error type structure