File tree Expand file tree Collapse file tree 3 files changed +3
-42
lines changed
JavaKeystoreConnect/src/main/java/javakeystoreconnect
PubSub/src/main/java/pubsub
SharedSubscription/src/main/java/sharedsubscription Expand file tree Collapse file tree 3 files changed +3
-42
lines changed Original file line number Diff line number Diff line change 20
20
21
21
public class JavaKeystoreConnect {
22
22
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
-
29
23
static CommandLineUtils cmdUtils ;
30
24
31
25
/*
32
26
* When called during a CI run, throw an exception that will escape and fail the exec:java task
33
27
* When called otherwise, print what went wrong (if anything) and just continue (return from main)
34
28
*/
35
29
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 );
41
31
}
42
32
43
33
public static void main (String [] args ) {
Original file line number Diff line number Diff line change 23
23
24
24
public class PubSub {
25
25
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
-
32
26
static CommandLineUtils cmdUtils ;
33
27
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
- */
38
28
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 );
44
30
}
45
31
46
32
static final class SampleLifecycleEvents implements Mqtt5ClientOptions .LifecycleEvents {
Original file line number Diff line number Diff line change 21
21
import utils .commandlineutils .CommandLineUtils ;
22
22
23
23
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 );
31
24
32
25
/* Used for command line processing */
33
26
static CommandLineUtils cmdUtils ;
34
27
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
- */
39
28
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 );
45
30
}
46
31
47
32
/**
You can’t perform that action at this time.
0 commit comments