ClosedBit error docs

CB_ERR_TRUNCATION

Unsafe truncation. A conversion would lose information, usually from a larger numeric lane into a smaller lane.

Why it happens

A conversion would lose information, usually from a larger numeric lane into a smaller lane.

How to fix it

Use an explicit clamp or choose a type wide enough to hold the value.

Copy-paste fix pattern
library CB-Math

fn main() {
    u8 byteValue = CB-Math.clamp(source_value, 0, 255)
    save byteValue
}
Runtime and Studio now show this kind of page from the error dialog: plain message first, stable code second, original details third.