Skip to content

Commit 9ca3a92

Browse files
Catch errors in Dispatchers and log (#1200)
Signed-off-by: Maurice van Veen <[email protected]>
1 parent aa600d4 commit 9ca3a92

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/main/java/io/nats/client/impl/NatsDispatcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ public void run() {
106106
handler.onMessage(msg);
107107
} catch (Exception exp) {
108108
connection.processException(exp);
109+
} catch (Error err) {
110+
connection.processException(new Exception(err));
109111
}
110112

111113
if (sub.reachedUnsubLimit()) {

src/main/java/io/nats/client/impl/NatsDispatcherWithExecutor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public void run() {
4848
finalHandler.onMessage(msg);
4949
} catch (Exception exp) {
5050
connection.processException(exp);
51+
} catch (Error err) {
52+
connection.processException(new Exception(err));
5153
}
5254

5355
if (sub.reachedUnsubLimit()) {

0 commit comments

Comments
 (0)