Skip to content

Commit a62d98e

Browse files
Fixed error massage
1 parent 2d3064d commit a62d98e

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

tpu/src/main/java/tpu/DeleteForceQueuedResource.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
import org.threeten.bp.Duration;
2828

2929
public class DeleteForceQueuedResource {
30-
public static void main(String[] args) {
30+
public static void main(String[] args)
31+
throws IOException, ExecutionException, InterruptedException {
3132
// TODO(developer): Replace these variables before running the sample.
3233
// Project ID or project number of the Google Cloud project.
3334
String projectId = "YOUR_PROJECT_ID";
@@ -41,7 +42,8 @@ public static void main(String[] args) {
4142

4243
// Deletes a Queued Resource asynchronously with --force flag.
4344
public static void deleteForceQueuedResource(
44-
String projectId, String zone, String queuedResourceId) {
45+
String projectId, String zone, String queuedResourceId)
46+
throws IOException, ExecutionException, InterruptedException {
4547
String name = String.format("projects/%s/locations/%s/queuedResources/%s",
4648
projectId, zone, queuedResourceId);
4749
// With these settings the client library handles the Operation's polling mechanism
@@ -68,7 +70,7 @@ public static void deleteForceQueuedResource(
6870

6971
tpuClient.deleteQueuedResourceAsync(request).get();
7072

71-
} catch (UnknownException | InterruptedException | ExecutionException | IOException e) {
73+
} catch (UnknownException e) {
7274
System.out.println(e.getMessage());
7375
}
7476
System.out.printf("Deleted Queued Resource: %s\n", name);

tpu/src/main/java/tpu/DeleteQueuedResource.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
//import java.util.concurrent.TimeUnit;
3232

3333
public class DeleteQueuedResource {
34-
public static void main(String[] args) {
34+
public static void main(String[] args)
35+
throws IOException, ExecutionException, InterruptedException {
3536
// TODO(developer): Replace these variables before running the sample.
3637
// Project ID or project number of the Google Cloud project.
3738
String projectId = "YOUR_PROJECT_ID";
@@ -44,7 +45,8 @@ public static void main(String[] args) {
4445
}
4546

4647
// Deletes a Queued Resource asynchronously.
47-
public static void deleteQueuedResource(String projectId, String zone, String queuedResourceId) {
48+
public static void deleteQueuedResource(String projectId, String zone, String queuedResourceId)
49+
throws ExecutionException, InterruptedException, IOException {
4850
String name = String.format("projects/%s/locations/%s/queuedResources/%s",
4951
projectId, zone, queuedResourceId);
5052
// With these settings the client library handles the Operation's polling mechanism
@@ -82,7 +84,7 @@ public static void deleteQueuedResource(String projectId, String zone, String qu
8284

8385
tpuClient.deleteQueuedResourceAsync(request).get();
8486

85-
} catch (UnknownException | InterruptedException | ExecutionException | IOException e) {
87+
} catch (UnknownException e) {
8688
System.out.println(e.getMessage());
8789
}
8890
System.out.printf("Deleted Queued Resource: %s\n", name);

tpu/src/test/java/tpu/QueuedResourceIT.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ public void testGetQueuedResource() throws IOException {
131131
}
132132

133133
@Test
134-
public void testDeleteQueuedResource() throws ExecutionException, InterruptedException {
134+
public void testDeleteQueuedResource()
135+
throws ExecutionException, InterruptedException, IOException {
135136
try (MockedStatic<TpuClient> mockedTpuClient = mockStatic(TpuClient.class)) {
136137
TpuClient mockTpuClient = mock(TpuClient.class);
137138
OperationFuture mockFuture = mock(OperationFuture.class);
@@ -152,7 +153,8 @@ public void testDeleteQueuedResource() throws ExecutionException, InterruptedExc
152153
}
153154

154155
@Test
155-
public void testDeleteForceQueuedResource() throws ExecutionException, InterruptedException {
156+
public void testDeleteForceQueuedResource()
157+
throws ExecutionException, InterruptedException, IOException {
156158
try (MockedStatic<TpuClient> mockedTpuClient = mockStatic(TpuClient.class)) {
157159
TpuClient mockTpuClient = mock(TpuClient.class);
158160
OperationFuture mockFuture = mock(OperationFuture.class);

0 commit comments

Comments
 (0)