Catch the correct exception type and log warning