Throw an exception if the creation of the MqttClient fails.