Replies: 1 comment
-
Hello, I prepared this example to test and it looks like I am getting the exception in handler:
The output is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have hard times with the exception handling for the kmqtt library. What I'm currently doing is:
CoroutineScope(Dispatchers.IO + exceptionHandler).launch { mqttClient.step() }
The problem: I don't get the correct exception in the exceptionHandler. I see in my coroutine handler an IllegalArgumentException but I see a MQTTException with BAD_USER_NAME_OR_PASSWORD in the private field
lastException
of the mqttClient.How can I access/handle the MQTTException correctly? Can we make the private field
lastException
public? Or can we pass a new parameter in the constructor of MQTTClient to handle exceptions?Thank you for the help in advance
Beta Was this translation helpful? Give feedback.
All reactions