Skip to content

Commit

Permalink
Replace InterruptedException with TimeoutException
Browse files Browse the repository at this point in the history
InterruptedException is an exception mostly used for
thread synchronization. In this context better to use
a more generic TimeoutException.
  • Loading branch information
pditommaso committed Aug 8, 2019
1 parent f91ae09 commit a6d3c24
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -16,6 +16,8 @@

package nextflow.cloud.google

import java.util.concurrent.TimeoutException

import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.googleapis.json.GoogleJsonResponseException
Expand Down Expand Up @@ -172,7 +174,7 @@ class GceApiHelper {
Thread.sleep(pollingIntervalMs)
long elapsed = System.currentTimeMillis() - start
if (elapsed >= timeoutMs) {
throw new InterruptedException("Timed out waiting for operation to complete")
throw new TimeoutException("Timed out waiting for operation to complete")
}
if (opZone != null) {
Compute.ZoneOperations.Get get = compute.zoneOperations().get(project, opZone, opId)
Expand Down

0 comments on commit a6d3c24

Please sign in to comment.