Class MqttException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.openhab.core.io.transport.mqtt.MqttException
All Implemented Interfaces:
Serializable

@NonNullByDefault public class MqttException extends Exception
Thrown if an error occurs communicating with the server. The exception contains a reason code. The semantic of the reason code depends on the underlying implementation.
Author:
David Graeff - Initial contribution
See Also:
  • Constructor Details

    • MqttException

      public MqttException(String reason)
      Constructs a new MqttException with the specified reason
      Parameters:
      reason - the reason for the exception.
    • MqttException

      public MqttException(Throwable cause)
      Constructs a new MqttException with the specified Throwable as the underlying reason.
      Parameters:
      cause - the underlying cause of the exception.
  • Method Details

    • getCause

      public @Nullable Throwable getCause()
      Returns the underlying cause of this exception, if available.
      Overrides:
      getCause in class Throwable
      Returns:
      the Throwable that was the root cause of this exception, which may be null.
    • getMessage

      public @Nullable String getMessage()
      Returns the detail message for this exception. May be null.
      Overrides:
      getMessage in class Throwable
    • toString

      public String toString()
      Returns a String representation of this exception.
      Overrides:
      toString in class Throwable