Catch the right type of exception