ErrorUtils

object ErrorUtils: Any

Prolog error handling utilities

Fields

Name Description
const errorWrapperFunctor: String

The functor error used to wrap errors generated by built-ins

Methods

errorStructOf

fun errorStructOf(errorDescription: Struct, customErrorData: Term): Struct

The error struct, with errorWrapperFunctor, that can be used in throw/1 predicate; It will create a struct in the form of error(errorDescription, customErrorData)

For example if the errorDescription is instantiation_error the corresponding error struct, according to prolog standard, will be error(instantiation_error, customErrorData)

If the error errorDescription is composite like type_error(callable, Goal) the corresponding struct, according to prolog standard, will be error(type_error(callable, Goal), customErrorData)

Parameters

Name Description
errorDescription: Struct
customErrorData: Term

ReturnValue

Name Description
Struct