     }
 
     private func fail(withReason reason: MeshSetupFlowError, severity: MeshSetupErrorSeverity = .Error, nsError: Error? = nil) {
-        log("error: \(reason.localizedDescription), nsError: \(nsError?.localizedDescription)")
+        log("error: \(reason.localizedDescription), nsError: \(nsError?.localizedDescription as Optional)")
         self.delegate.meshSetupError(error: reason, severity: severity, nsError: nsError)
     }
 

        self.initialDevice.transceiver!.sendGetConnectionStatus { result, status in
            self.log("initialDevice.sendGetConnectionStatus: \(result)")
            if (result == .NONE) {
                self.log("status: \(status)")
                if (status! == .connected) {
                    self.log("device connected to the cloud")
                    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(5)) {


    func meshSetupDidRequestToChooseBetweenRetryInternetOrSwitchToJoinerFlow(setSwitchToJoiner: @escaping MeshSetupSetBool)


    func meshSetupDidEnterState(state: MeshSetupFlowState)
    func meshSetupError(error: MeshSetupFlowError, severity: MeshSetupErrorSeverity, nsError: Error?)
}
