Hello,
Out of bounds errors are described in the Error Handling Rationale fundamental document as "logic failures":
The final category is logic failures, including out of bounds array accesses, forced unwrap of
nil
optionals, and other kinds of assertions. The programmer has made a mistake, and the failure should be handled by fixing the code, not by attempting to recover dynamically.
As the recommended handling of such an error is fixing the code, those errors are currently not recoverable at all: the program crashes and you handle them by... fixing your code.
However the door is not closed. The rationale continues:
The correct handling of these error conditions is an open question and is not a focus of this proposal. Should we decide to make them recoverable, they will likely follow the same implementation mechanism as universal errors, if not necessarily the same language rules.
And indeed there are plans to make them recoverable in a future Swift version. See the [Concurrency] async/await + actors thread, and especially this chapter of the pitch: Part 3: Reliability through fault isolation
Until then (Swift 6? 7?), it is highly unlikely that you will be able to capture out-of-bounds errors.