Handle connection errors.