PrologError

abstract class PrologError: TuPrologRuntimeException

Base class for Standard Prolog Errors and possibly other custom Primitive errors

Fields

Name Description
val errorStruct: Struct

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

open type: Struct

The error type structure

open extraData: Term?

The possible extra data to be carried with the error

Constructors

<init>

constructor(cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?)

Parameters

Name Description
cause: Throwable?
context: ExecutionContext
type: Struct
extraData: Term?

<init>

constructor(message: String?, cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?)

Base class for Standard Prolog Errors and possibly other custom Primitive errors

Parameters

Name Description
message: String?

the detail message string.

cause: Throwable?

the cause of this exception.

context: ExecutionContext

The current context at exception creation

type: Struct

The error type structure

extraData: Term?

The possible extra data to be carried with the error

Methods

updateContext

open fun updateContext(newContext: ExecutionContext): PrologError

Creates a new exception instance with context field updated to newContext.

Subclasses should override this method and return the correct instance.

Parameters

Name Description
newContext: ExecutionContext

ReturnValue

Name Description
PrologError

toString

open fun toString(): String

ReturnValue

Name Description
String

CompanionObject

PrologError

abstract class PrologError: TuPrologRuntimeException

Base class for Standard Prolog Errors and possibly other custom Primitive errors

Methods

of

fun of(message: String?, cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?): PrologError

Factory method for PrologErrors

It creates correct subclass instance if type detected, otherwise defaulting to a PrologError instance

Parameters

Name Description
message: String?
cause: Throwable?
context: ExecutionContext
type: Struct
extraData: Term?

ReturnValue

Name Description
PrologError