Handle port-closed error