report
Throws. This is CL++‘s analog of C++ throw / Luau error. The current thread stops.
Syntax
Section titled “Syntax”void report(...);Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
... | any | Error payload (usually a string). |
Return value
Section titled “Return value”Does not return.
Luau emit
Section titled “Luau emit”error(...)
Description
Section titled “Description”There is no try/catch in CL++. Use pcall when you need to catch a failure. report is for unrecoverable states.
Example
Section titled “Example”if (coins < 0) { report("Balance sync error.");}Emits:
if coins < 0 then error("Balance sync error.")end