Skip to content

report

I/O · builtin

Throws. This is CL++‘s analog of C++ throw / Luau error. The current thread stops.

void report(...);
NameTypeDescription
...anyError payload (usually a string).

Does not return.

error(...)

There is no try/catch in CL++. Use pcall when you need to catch a failure. report is for unrecoverable states.

if (coins < 0) {
report("Balance sync error.");
}

Emits:

if coins < 0 then
error("Balance sync error.")
end

post · warn · pcall