Dim no As NativeObject = mqttClient
Dim noClient As NativeObject = no.GetField("client")
Sleep(0) 'noErrorCode is never initialised otherwise
Dim noErrorCode As NativeObject = noClient.GetField("lastErrorCode")
If noErrorCode.IsInitialized Then
connectErrCode = noErrorCode.RunMethod("code", Null).AsNumber
connectErrDesc = noErrorCode.AsString
Log ($"${connectErrDesc} (${connectErrCode})"$)
End If