rescue exception when parsing hosts