MQTTnet
MQTTnet copied to clipboard
rethrow MqttClientUnexpectedDisconnectReceivedException when Publish …
rethrow MqttClientUnexpectedDisconnectReceivedException when QoS is 0 and Publish errors out because server disconnects the client.
@chkr1011 fyi
@chkr1011 any thoughts on the concern I raised? Or if not, can you approve this PR?
I will add the breaking change to the release notes. Breaking changes are happening from time to time and cannot be avoided. In this case we still get an exception. Only the the type is different now. I added a comment to the code.
@fazho I made the change myself and also updated the release notes and added a comment. Please let me know if you agree with the changes (especially the comment). After that I will merge the PR.
@chkr1011 your changes look good to me. I just made another small change, setting the default inner exception as null in the constructor of MqttClientUnexpectedDisconnectReceivedException, so that if anyone explicitly creates an MqttClientUnexpectedDisconnectReceivedException object in their code (e.g., someone might mock the MQTTClient and create this exception in their unit tests), our changes in this PR will not break it.
I know this will be a breaking change either way, but just try to make the breaking part minimum.
@chkr1011 feel free to revert my latest change if it does not make sense to you. I am ok either way.