Skip to content

Commit 0b3018d

Browse files
feat!: remove a dummy WriterClosedException (#1726)
* feat: Remove a dummy WriterClosedException * . * . * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3694243 commit 0b3018d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

google-cloud-bigquerystorage/clirr-ignored-differences.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
<className>com/google/cloud/bigquery/storage/v1/Exceptions$StreamFinalizedException</className>
1212
<method>Exceptions$StreamFinalizedException(io.grpc.Status, io.grpc.Metadata, java.lang.String)</method>
1313
</difference>
14+
<difference>
15+
<differenceType>8001</differenceType>
16+
<className>com/google/cloud/bigquery/storage/v1/Exceptions$WriterClosedException</className>
17+
</difference>
1418
</differences>

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/Exceptions.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929

3030
/** Exceptions for Storage Client Libraries. */
3131
public final class Exceptions {
32-
public static class WriterClosedException extends Exception {
33-
public WriterClosedException(String streamName) {
34-
super("Writer closed on: " + streamName);
35-
}
36-
}
3732
/** Main Storage Exception. Might contain map of streams to errors for that stream. */
3833
public static class StorageException extends StatusRuntimeException {
3934

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,11 @@ private AppendRowsRequest prepareRequestBasedOnPosition(
562562
}
563563

564564
private void cleanupInflightRequests() {
565-
Throwable finalStatus = new Exceptions.WriterClosedException(streamName);
565+
Throwable finalStatus =
566+
new Exceptions.StreamWriterClosedException(
567+
Status.fromCode(Status.Code.FAILED_PRECONDITION)
568+
.withDescription("Connection is already closed, cleanup inflight request"),
569+
streamName);
566570
Deque<AppendRequestAndResponse> localQueue = new LinkedList<AppendRequestAndResponse>();
567571
this.lock.lock();
568572
try {

0 commit comments

Comments
 (0)