There’s an issue where, if no human readable message can be found for an error code, we only get "MqttException" without the actual error code. Implementation details:
- Not all languages have mappings from error codes to messages.
- Even in English, some codes are missing, for example, error code 128 (SUBSCRIBE_FAILED) has no mapping: https://github.com/eclipse-paho/paho.mqtt.java/blob/master/org.eclipse.paho.client.mqttv3/src/main/resources/org/eclipse/paho/client/mqttv3/internal/nls/messages.properties
public static void main(String[] args) {
MqttException error = new MqttException(REASON_CODE_SUBSCRIBE_FAILED);
System.out.println(error.getMessage()); // just MqttException
}
It's especially painful during logging, since we may get just "MqttException" without any cause, because broker replied with REASON_CODE_SUBSCRIBE_FAILED, for example.
There’s an issue where, if no human readable message can be found for an error code, we only get "MqttException" without the actual error code. Implementation details:
It's especially painful during logging, since we may get just "MqttException" without any cause, because broker replied with REASON_CODE_SUBSCRIBE_FAILED, for example.