ClosedBit error docs

CB_ERR_RENDER_RANGE

Render value out of range. A render dimension, line width, grid count, color, or font size is outside the allowed range.

Why it happens

A render dimension, line width, grid count, color, or font size is outside the allowed range.

How to fix it

Clamp render arguments before drawing.

Copy-paste fix pattern
library CB-Render
library CB-Math

fn main() {
    init_window(640, 360, "Safe draw")
    u256 fontSize = CB-Math.clamp(user_size, 1, 512)
    draw_text(24, 24, "Safe", 0xFFFFFF, fontSize)
}
Runtime and Studio now show this kind of page from the error dialog: plain message first, stable code second, original details third.