DomainError

class DomainError: PrologError

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

Fields

Name Description
val type: Struct

The error type structure

val expectedDomain: Expected

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

val actualValue: Term

The value not respecting expectedDomain

Constructors

<init>

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

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

Parameters

Name Description
message: String?

the detail message string.

cause: Throwable?

the cause of this exception.

context: ExecutionContext

The current context at exception creation

expectedDomain: Expected

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

actualValue: Term

The value not respecting expectedDomain

extraData: Term?

The possible extra data to be carried with the error

CompanionObject

DomainError

class DomainError: PrologError

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

Fields

Name Description
const typeFunctor: String

The domain error Struct functor

Methods

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

forGoal

fun forGoal(context: ExecutionContext, procedure: Signature, expectedDomain: Expected, actualValue: Term): actualValue` of ${procedure.toIndicator()} is not $expectedDomain term".let { DomainError( message = it, context = context, expectedDomain = expectedDomain, actualValue = actualValue, extraData = Atom.of(it) ) }

Parameters

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

ReturnValue

Name Description
actualValue` of ${procedure.toIndicator()} is not $expectedDomain term".let { DomainError( message = it, context = context, expectedDomain = expectedDomain, actualValue = actualValue, extraData = Atom.of(it) ) }