Skip to content

Commit 1db8bda

Browse files
committed
Added try-catch around user-defined code
1 parent f5b5df8 commit 1db8bda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

topic/src/main/java/tech/ydb/topic/impl/GrpcStreamRetrier.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ protected void onSessionClosed(Status status, Throwable th) {
137137
}
138138

139139
if (errorsHandler != null) {
140-
errorsHandler.accept(status, th);
140+
try {
141+
errorsHandler.accept(status, th);
142+
} catch (Exception ex) {
143+
getLogger().error("[{}] error handler throws exception", id, ex);
144+
}
141145
}
142146

143147
if (!isStopped.get()) {

0 commit comments

Comments
 (0)