Skip to content

Commit 9201de5

Browse files
authored
docs: catch actual exception in java doc comment (#312)
Fixes #309
1 parent 466d08f commit 9201de5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,9 @@ public ReadChannel reader(BlobSourceOption... options) {
726726
* <pre>{@code
727727
* byte[] content = "Hello, World!".getBytes(UTF_8);
728728
* try (WriteChannel writer = blob.writer()) {
729-
* try {
730729
* writer.write(ByteBuffer.wrap(content, 0, content.length));
731-
* } catch (Exception ex) {
732-
* // handle exception
733-
* }
730+
* } catch (IOException ex) {
731+
* // handle exception
734732
* }
735733
* }</pre>
736734
*

google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -2503,11 +2503,9 @@ Blob create(
25032503
* byte[] content = "Hello, World!".getBytes(UTF_8);
25042504
* BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
25052505
* try (WriteChannel writer = storage.writer(blobInfo)) {
2506-
* try {
25072506
* writer.write(ByteBuffer.wrap(content, 0, content.length));
2508-
* } catch (Exception ex) {
2509-
* // handle exception
2510-
* }
2507+
* } catch (IOException ex) {
2508+
* // handle exception
25112509
* }
25122510
* }</pre>
25132511
*

0 commit comments

Comments
 (0)