MetisRuntimeException

open class MetisRuntimeException(val type: String, actualMessage: String, companionData: Value.Table = Value.Table(), cause: Throwable? = null) : MetisException, Value

A runtime exception that can be thrown from Metis code.

Parameters

type

The type of the exception.

actualMessage

The message of the exception.

companionData

The companion data of the exception.

cause

The cause of the exception.

Constructors

Link copied to clipboard
constructor(type: String, actualMessage: String, companionData: Value.Table = Value.Table(), cause: Throwable? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?
Link copied to clipboard
open override var metatable: Value.Table?

The metatable of this value.

Link copied to clipboard

Functions

Link copied to clipboard
fun addStackFrame(span: Span)

Adds a stack frame to the backtrace.

Link copied to clipboard
Link copied to clipboard
inline fun <T> Value.asObj(): T

If this is a Value.Native, returns the native object, otherwise throws an error.

Link copied to clipboard

Converts this value to a kotlin.Boolean, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.Bytes, or throws an error if it cannot be converted.

Link copied to clipboard
inline fun <T : Value> Value.convertTo(): T

Converts this value to a T, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Double, or throws an error if it cannot be converted.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Converts this value to a Int, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.List, or throws an error if it cannot be converted.

Link copied to clipboard
fun Value.lookUp(key: Value): Value?

Look up a value in this value, possibly using the metatable.

Link copied to clipboard
open override fun lookUpDirect(key: Value): Value?

Look up a value in this value.

Link copied to clipboard
fun Value.lookUpHierarchy(vararg keys: String): Value?

Look up a successive sequence of strings in this value.

Link copied to clipboard

If this value is null, return Value.Null, otherwise return this value.

Link copied to clipboard
Link copied to clipboard
fun report(sourceName: String): String

Returns a string representation of this exception.

Link copied to clipboard
fun Value.set(key: Value, value: Value): Boolean

Sets a value in this value, possibly using the metatable.

Link copied to clipboard
open override fun setDirect(key: Value, value: Value): Boolean

Set a value in this value.

Link copied to clipboard
fun Value.setOrError(key: Value, value: Value)

Sets a value in this value, or throws an error if it cannot be set.

Link copied to clipboard
Link copied to clipboard

Converts this value to a String, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.Table, or throws an error if it cannot be converted.