Handle connection exceptions