Clarify index error message.
Use custom exception type for human readable errors.

Prevents catching unrelated value errors,
and makes it more clear why there is a parse_int function.