Skip to content

Commit

Permalink
feat!: remove a dummy WriterClosedException (#1726)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
yirutang and gcf-owl-bot[bot] authored Aug 4, 2022
1 parent 3694243 commit 0b3018d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions google-cloud-bigquerystorage/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
<className>com/google/cloud/bigquery/storage/v1/Exceptions$StreamFinalizedException</className>
<method>Exceptions$StreamFinalizedException(io.grpc.Status, io.grpc.Metadata, java.lang.String)</method>
</difference>
<difference>
<differenceType>8001</differenceType>
<className>com/google/cloud/bigquery/storage/v1/Exceptions$WriterClosedException</className>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@

/** Exceptions for Storage Client Libraries. */
public final class Exceptions {
public static class WriterClosedException extends Exception {
public WriterClosedException(String streamName) {
super("Writer closed on: " + streamName);
}
}
/** Main Storage Exception. Might contain map of streams to errors for that stream. */
public static class StorageException extends StatusRuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,11 @@ private AppendRowsRequest prepareRequestBasedOnPosition(
}

private void cleanupInflightRequests() {
Throwable finalStatus = new Exceptions.WriterClosedException(streamName);
Throwable finalStatus =
new Exceptions.StreamWriterClosedException(
Status.fromCode(Status.Code.FAILED_PRECONDITION)
.withDescription("Connection is already closed, cleanup inflight request"),
streamName);
Deque<AppendRequestAndResponse> localQueue = new LinkedList<AppendRequestAndResponse>();
this.lock.lock();
try {
Expand Down

0 comments on commit 0b3018d

Please sign in to comment.