Catch the correct exception.