Use the correct type of exception