how to check if a statement in python throws an error code example Example: throwing an exception python raise Exception("message")