Handle connection errors