A defect is designed to show a coding/logic error and is not intended to be caught. If you still want to raise an exception, you can check for -1 and the intentionally raise some other exception that you can catch. Alternatively you could probably wrap the whole code chunk in an if statement `if c >= 0: code`
- unhandled exception: index -1 not in 0 .. 12 [IndexDefect] stbalbach
- unhandled exception: index -1 not in 0 .. 12 [IndexDefect] namisboss