Skip to content

Commit af96f23

Browse files
Fix catches
1 parent 079acc4 commit af96f23

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

samples/snippets/src/main/java/pubsub/SubscribeAsyncLimitedConcurrencyExample.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
public class SubscribeAsyncLimitedConcurrencyExample {
4343
public static void main(String... args) throws Exception {
4444
// TODO(developer): Replace these variables before running the sample.
45-
String projectId = "my-project";
46-
String subscriptionId = "my-subscription";
45+
String projectId = "ordering-keys-testing";
46+
String subscriptionId = "threads-test";
4747

4848
subscribeAsyncLimitedConcurrencyExample(projectId, subscriptionId);
4949
}
@@ -145,7 +145,8 @@ public static void subscribeAsyncLimitedConcurrencyExample(
145145
try {
146146
Thread.sleep(30000);
147147
} catch (Exception e) {
148-
148+
System.out.println("Could not sleep: " + e);
149+
return;
149150
}
150151
printThreads();
151152

samples/snippets/src/main/java/pubsub/SubscribeAsyncUnlimitedConcurrencyExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public static void subscribeAsyncUnlimitedConcurrencyExample(
6868
try {
6969
Thread.sleep(30000);
7070
} catch (Exception e) {
71-
71+
System.out.println("Could not sleep: " + e);
72+
return;
7273
}
7374
printThreads();
7475
for (Subscriber subscriber : subscribers) {

0 commit comments

Comments
 (0)