Skip to content

failure

luau
local failure = require("@std/test/failure")

WARNING

These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.

Summary

EntryDescription
assertionReturns a Failure describing an assertion failure at the call site, with msg as the failure message.
lifecycleReturns a Failure describing an error that occurred in the hook lifecycle callback.
runtimeerrorReturns a Failure describing an unhandled runtime error, including a stack trace.

Functions and Properties

failure.assertion

Returns a Failure describing an assertion failure at the call site, with msg as the failure message.

luau
(msg: string, depth: number?, negation: boolean?) -> Failure

failure.lifecycle

Returns a Failure describing an error that occurred in the hook lifecycle callback.

luau
(hook: types.Hook, err) -> Failure

failure.runtimeerror

Returns a Failure describing an unhandled runtime error, including a stack trace.

luau
(err) -> Failure