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() {
    u256 wide = 999
    u8 byteValue = CB-Math.clamp(wide, 0, 255)
    save byteValue
}
If the IDE reports a line number, fix that line first, then scan the previous line for an unclosed string, bracket, or block.