Skip to content

Commit 94f7ea6

Browse files
committed
remove isCI from samples
1 parent b00bea7 commit 94f7ea6

File tree

3 files changed

+3
-42
lines changed

3 files changed

+3
-42
lines changed

samples/JavaKeystoreConnect/src/main/java/javakeystoreconnect/JavaKeystoreConnect.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,14 @@
2020

2121
public class JavaKeystoreConnect {
2222

23-
// When run normally, we want to exit nicely even if something goes wrong
24-
// When run from CI, we want to let an exception escape which in turn causes the
25-
// exec:java task to return a non-zero exit code
26-
static String ciPropValue = System.getProperty("aws.crt.ci");
27-
static boolean isCI = ciPropValue != null && Boolean.valueOf(ciPropValue);
28-
2923
static CommandLineUtils cmdUtils;
3024

3125
/*
3226
* When called during a CI run, throw an exception that will escape and fail the exec:java task
3327
* When called otherwise, print what went wrong (if anything) and just continue (return from main)
3428
*/
3529
static void onApplicationFailure(Throwable cause) {
36-
if (isCI) {
37-
throw new RuntimeException("JavaKeystoreConnect execution failure", cause);
38-
} else if (cause != null) {
39-
System.out.println("Exception encountered: " + cause.toString());
40-
}
30+
throw new RuntimeException("JavaKeystoreConnect execution failure", cause);
4131
}
4232

4333
public static void main(String[] args) {

samples/Mqtt5/PubSub/src/main/java/pubsub/PubSub.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,10 @@
2323

2424
public class PubSub {
2525

26-
// When run normally, we want to exit nicely even if something goes wrong
27-
// When run from CI, we want to let an exception escape which in turn causes the
28-
// exec:java task to return a non-zero exit code
29-
static String ciPropValue = System.getProperty("aws.crt.ci");
30-
static boolean isCI = ciPropValue != null && Boolean.valueOf(ciPropValue);
31-
3226
static CommandLineUtils cmdUtils;
3327

34-
/*
35-
* When called during a CI run, throw an exception that will escape and fail the exec:java task
36-
* When called otherwise, print what went wrong (if anything) and just continue (return from main)
37-
*/
3828
static void onApplicationFailure(Throwable cause) {
39-
if (isCI) {
40-
throw new RuntimeException("Mqtt5 PubSub: execution failure", cause);
41-
} else if (cause != null) {
42-
System.out.println("Exception encountered: " + cause.toString());
43-
}
29+
throw new RuntimeException("Mqtt5 PubSub: execution failure", cause);
4430
}
4531

4632
static final class SampleLifecycleEvents implements Mqtt5ClientOptions.LifecycleEvents {

samples/Mqtt5/SharedSubscription/src/main/java/sharedsubscription/SharedSubscription.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,12 @@
2121
import utils.commandlineutils.CommandLineUtils;
2222

2323
public class SharedSubscription {
24-
/**
25-
* When run normally, we want to exit nicely even if something goes wrong
26-
* When run from CI, we want to let an exception escape which in turn causes the
27-
* exec:java task to return a non-zero exit code
28-
*/
29-
static String ciPropValue = System.getProperty("aws.crt.ci");
30-
static boolean isCI = ciPropValue != null && Boolean.valueOf(ciPropValue);
3124

3225
/* Used for command line processing */
3326
static CommandLineUtils cmdUtils;
3427

35-
/*
36-
* When called during a CI run, throw an exception that will escape and fail the exec:java task
37-
* When called otherwise, print what went wrong (if anything) and just continue (return from main)
38-
*/
3928
static void onApplicationFailure(Throwable cause) {
40-
if (isCI) {
41-
throw new RuntimeException("Mqtt5 SharedSubscription: execution failure", cause);
42-
} else if (cause != null) {
43-
System.out.println("Exception encountered: " + cause.toString());
44-
}
29+
throw new RuntimeException("Mqtt5 SharedSubscription: execution failure", cause);
4530
}
4631

4732
/**

0 commit comments

Comments
 (0)