DomainError

class DomainError: LogicError

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

Fields

Name Description
val type: Struct

The error type structure

val expectedDomain: Expected

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

val culprit: Term

The value not respecting expectedDomain

Constructors

<init>

constructor(message: String?, cause: Throwable?, context: ExecutionContext, expectedDomain: Expected, actualValue: Term, extraData: Term?)

Parameters

Name Description
message: String?
cause: Throwable?
context: ExecutionContext
expectedDomain: Expected
actualValue: Term
extraData: Term?

<init>

constructor(message: String?, cause: Throwable?, contexts: Array<ExecutionContext>, expectedDomain: Expected, culprit: Term, extraData: Term?)

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

Parameters

Name Description
message: String?

the detail message string.

cause: Throwable?

the cause of this exception.

contexts: Array<ExecutionContext>

a stack of contexts localising the exception

expectedDomain: Expected

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

culprit: Term

The value not respecting expectedDomain

extraData: Term?

The possible extra data to be carried with the error

Methods

updateContext

fun updateContext(newContext: ExecutionContext, index: Int): 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.

Parameters

Name Description
newContext: ExecutionContext
index: Int

ReturnValue

Name Description
DomainError

updateLastContext

fun updateLastContext(newContext: ExecutionContext): DomainError

Parameters

Name Description
newContext: ExecutionContext

ReturnValue

Name Description
DomainError

pushContext

fun pushContext(newContext: ExecutionContext): DomainError

Parameters

Name Description
newContext: ExecutionContext

ReturnValue

Name Description
DomainError

CompanionObject

DomainError

class DomainError: LogicError

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

Fields

Name Description
const typeFunctor: String

The domain error Struct functor

Methods

forFlagValues

fun forFlagValues(context: ExecutionContext, procedure: Signature, flagValues: Iterable<Term>, actualValue: Term, index: Int?): DomainError

Parameters

Name Description
context: ExecutionContext
procedure: Signature
flagValues: Iterable<Term>
actualValue: Term
index: Int?

ReturnValue

Name Description
DomainError

forArgument

fun forArgument(context: ExecutionContext, procedure: Signature, expectedDomain: Expected, actualValue: Term, index: Int?): DomainError

Parameters

Name Description
context: ExecutionContext
procedure: Signature
expectedDomain: Expected
actualValue: Term
index: Int?

ReturnValue

Name Description
DomainError

forTerm

fun forTerm(context: ExecutionContext, expectedDomain: Expected, actualValue: Term): DomainError

Parameters

Name Description
context: ExecutionContext
expectedDomain: Expected
actualValue: Term

ReturnValue

Name Description
DomainError

forGoal

fun forGoal(context: ExecutionContext, procedure: Signature, expectedDomain: Expected, actualValue: Term): DomainError

Parameters

Name Description
context: ExecutionContext
procedure: Signature
expectedDomain: Expected
actualValue: Term

ReturnValue

Name Description
DomainError