Improved exception messages in MqttVersion (#11228)

Motivation:
When checking the latest commit i saw some bad exception messages in MqttVersion hence i improved them.

Modification:

Improved exception messages in MqttVersion.

Result:

Better exception messages in MqttVersion.
This commit is contained in:
terrarier2111 2021-05-06 11:28:00 +02:00 committed by Norman Maurer
parent 743d44b7a2
commit fe5a56fc01

View File

@ -64,11 +64,11 @@ public enum MqttVersion {
break; break;
} }
if (mv == null) { if (mv == null) {
throw new MqttUnacceptableProtocolVersionException(protocolName + "is unknown protocol name"); throw new MqttUnacceptableProtocolVersionException(protocolName + " is an unknown protocol name");
} }
if (mv.name.equals(protocolName)) { if (mv.name.equals(protocolName)) {
return mv; return mv;
} }
throw new MqttUnacceptableProtocolVersionException(protocolName + " and " + protocolLevel + " are not match"); throw new MqttUnacceptableProtocolVersionException(protocolName + " and " + protocolLevel + " don't match");
} }
} }