Updated lost connection handler to publishe error event and log.