Skip to content

Commit 23074ea

Browse files
committed
Tie in SpannerExceptionFactory.propagateInterrupt
1 parent aad7ce0 commit 23074ea

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerApiFutures.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static <T> T getOrNull(ApiFuture<T> future) throws SpannerException {
3535
}
3636
throw SpannerExceptionFactory.newSpannerException(e.getCause());
3737
} catch (InterruptedException e) {
38-
throw SpannerExceptionFactory.propagateInterrupt(e);
38+
throw SpannerExceptionFactory.propagateInterrupt(e, null /*TODO: requestId*/);
3939
} catch (CancellationException e) {
4040
throw SpannerExceptionFactory.newSpannerExceptionForCancellation(
4141
null, e, null /*TODO: requestId*/);

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerExceptionFactory.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ public static SpannerException newSpannerException(
8181
}
8282

8383
public static SpannerException propagateInterrupt(InterruptedException e) {
84+
return propagateInterrupt(e, null);
85+
}
86+
87+
public static SpannerException propagateInterrupt(
88+
InterruptedException e, XGoogSpannerRequestId reqId) {
8489
Thread.currentThread().interrupt();
85-
return SpannerExceptionFactory.newSpannerException(ErrorCode.CANCELLED, "Interrupted", e);
90+
return SpannerExceptionFactory.newSpannerException(
91+
ErrorCode.CANCELLED, "Interrupted", e, reqId);
8692
}
8793

8894
/**

0 commit comments

Comments
 (0)