ClosedBit error docs

CB_ERR_RANGE

Value out of accepted range. A number, dimension, color, memory cap, shift amount, or index exceeded the supported range.

Why it happens

A number, dimension, color, memory cap, shift amount, or index exceeded the supported range.

How to fix it

Clamp the value before passing it to the function that enforces the range.

Copy-paste fix pattern
library CB-Math

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