Correctly handle connection failure with the daemon