You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by invisicow January 17, 2025
Hi,
I am testing my error handling when calling PublishAsync() to a bad topic, such as "####", but I am getting unexpected behavior.
Expected:
I expected PublishAsync() to return an MqttClientPublishResult instance with ReasonCode having value MqttClientPublishReasonCode.TopicNameInvalid.
Actual:
Instead, I am getting exception
MQTTnet.Exceptions.MqttProtocolViolationException: 'The character '#' is not allowed in topics.'
This is rather unfortunate, because using specific MqttClientPublishReasonCode values from the MqttClientPublishResult would help my error handling. Is there a way to receive this result object back without the method throwing an error?
Thank you.
The text was updated successfully, but these errors were encountered:
Discussed in #2139
Originally posted by invisicow January 17, 2025
Hi,
I am testing my error handling when calling
PublishAsync()
to a bad topic, such as "####", but I am getting unexpected behavior.Expected:
I expected
PublishAsync()
to return anMqttClientPublishResult
instance withReasonCode
having valueMqttClientPublishReasonCode.TopicNameInvalid
.Actual:
Instead, I am getting exception
This is rather unfortunate, because using specific
MqttClientPublishReasonCode
values from theMqttClientPublishResult
would help my error handling. Is there a way to receive this result object back without the method throwing an error?Thank you.
The text was updated successfully, but these errors were encountered: