loggedAssert
Call Signature
Section titled “Call Signature”loggedAssert(
condition,code,options?):asserts condition
Defined in: util.ts:40
Asserts that condition is truthy, logging a formatted error message before failing
if the condition is false.
The logged output follows the format {prefix}:{code} or {prefix}:{code}:{message}
and is compatible with ARC-56 and ARC-32 clients.
Note that this will generate extra bytecode, so it is strongly advised to keep your messages and error codes short.
Parameters
Section titled “Parameters”condition
Section titled “condition”unknown
The condition to assert; if false, logs an error and fails.
string
An error code. Must not contain :. Should be alphanumeric.
options?
Section titled “options?”An optional object containing the message and prefix for the error.
message?
Section titled “message?”string
Message appended after the code. Must not contain :.
Defaults to no message.
prefix?
Section titled “prefix?”"ERR" | "AER"
Error prefix, either "ERR" or "AER". Defaults to "ERR".
Returns
Section titled “Returns”asserts condition
Call Signature
Section titled “Call Signature”loggedAssert(
condition,code,message):asserts condition
Defined in: util.ts:59
Asserts that condition is truthy, logging a formatted error message before failing
if the condition is false.
The logged output follows the format ERR:{code}:{message} and is compatible with
ARC-56 and ARC-32 clients.
Note that this will generate extra bytecode, so it is strongly advised to keep your messages and error codes short.
Parameters
Section titled “Parameters”condition
Section titled “condition”unknown
The condition to assert; if false, logs an error and fails.
string
An error code. Must not contain :. Should be alphanumeric.
message
Section titled “message”string
Message appended after the code. Must not contain :.
Returns
Section titled “Returns”asserts condition