you should just do an if/else conditional instead of a try/except with a custom exception being raised inside.