Skip to content

Commit c99b1aa

Browse files
committed
Prevent killing application on exception
1 parent c028ed3 commit c99b1aa

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can either download the zip file from the releases on Github [here](https://
1717
<dependency>
1818
<groupId>ltg</groupId>
1919
<artifactId>simple-java-mqtt-client</artifactId>
20-
<version>1.0.2</version>
20+
<version>1.0.3</version>
2121
</dependency>
2222
</dependencies>
2323
...

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>ltg</groupId>
44
<artifactId>simple-java-mqtt-client</artifactId>
5-
<version>1.0.2</version>
5+
<version>1.0.3</version>
66
<name>Simple MQTT client for Java</name>
77

88
<properties>

src/main/java/ltg/commons/SimpleMQTTClient.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,16 @@ public void onSuccess(Void aVoid) {
7878
}
7979
@Override
8080
public void onFailure(Throwable throwable) {
81-
System.err.println("Impossible to CONNECT to the MQTT server, terminating");
82-
System.exit(1);
81+
System.err.println("Impossible to CONNECT to the MQTT server! This MQTT client is now useless, create a new one");
8382
}
8483
});
8584
try {
8685
if (!l.await(5, TimeUnit.SECONDS)) {
8786
// Waits 3 seconds and then timeouts
88-
System.err.println("Impossible to CONNECT to the MQTT server: TIMEOUT. Terminating");
89-
System.exit(1);
87+
System.err.println("Impossible to CONNECT to the MQTT server: TIMEOUT. This MQTT client is now useless, create a new one");
9088
}
9189
} catch (InterruptedException e) {
92-
System.err.println("Impossible to CONNECT to the MQTT server, terminating");
93-
System.exit(1);
90+
System.err.println("Impossible to CONNECT to the MQTT server. This MQTT client is useless, create a new one");
9491
}
9592
}
9693

0 commit comments

Comments
 (0)