fix: Async logging should not rethrow error in onFailure callback cor… · googleapis/java-logging@da92518 (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ If you are using Maven without BOM, add this to your dependencies:
51 51 If you are using Gradle 5.x or later, add this to your dependencies
52 52
53 53 ```Groovy
54 -implementation platform('com.google.cloud:libraries-bom:25.0.0')
54 +implementation platform('com.google.cloud:libraries-bom:25.1.0')
55 55
56 56 implementation 'com.google.cloud:google-cloud-logging'
57 57 ```
Original file line number Diff line number Diff line change
@@ -882,7 +882,7 @@ public void flush() {
882 882 try {
883 883 ApiFutures.allAsList(writesToFlush).get(FLUSH_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
884 884 } catch (InterruptedException | ExecutionException TimeoutException e) {
885 -System.err.println("ERROR: flush failure: " + e);
885 +throw new RuntimeException(e);
886 886 }
887 887 }
888 888
@@ -940,7 +940,7 @@ public void onSuccess(Void v) {
940 940 public void onFailure(Throwable t) {
941 941 try {
942 942 Exception ex = t instanceof Exception ? (Exception) t : new Exception(t);
943 -throw new RuntimeException(ex);
943 +System.err.println("ERROR: onFailure exception: " + ex);
944 944 } finally {
945 945 removeFromPending();
946 946 }