ClosedBit error docs

CB_ERR_ARRAY_INDEX

Array index out of range. The program tried to read or write an array slot that does not exist.

Why it happens

The program tried to read or write an array slot that does not exist.

How to fix it

Check len(array), clamp the index to 0..len(array)-1, or create the missing item before assignment.

Copy-paste fix pattern
fn main() {
    array names = ["Ada", "Grace"]
    u256 at = 1
    if (at < len(names)) {
        println(names[at])
    } else {
        println("No item at that index")
    }
}
Runtime and Studio now show this kind of page from the error dialog: plain message first, stable code second, original details third.