The print statement needs to be executed BEFORE the statement where the exception happens. Otherwise it will never be executed.