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`

Reply via email to