Manually handle localStorage errors