Skip to content

Commit 6bbafcd

Browse files
committed
[event-bus] Handle Json parsing error such that future messages are not blocked
1 parent 7941e12 commit 6bbafcd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/src/org/openqa/selenium/events/zeromq/UnboundZmqEventBus.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.openqa.selenium.grid.security.Secret;
2828
import org.openqa.selenium.internal.Require;
2929
import org.openqa.selenium.json.Json;
30+
import org.openqa.selenium.json.JsonException;
3031
import org.openqa.selenium.json.JsonOutput;
3132
import org.zeromq.SocketType;
3233
import org.zeromq.ZContext;
@@ -256,6 +257,9 @@ public void run() {
256257
} catch (Exception e) {
257258
if (e.getCause() instanceof AssertionError) {
258259
// Do nothing.
260+
} else if (e instanceof JsonException) {
261+
LOG.log(Level.WARNING, e, () -> "Caught exception while parsing for event bus messages: "
262+
+ e.getMessage());
259263
} else {
260264
LOG.log(Level.WARNING, e, () -> "Caught exception while polling for event bus messages: "
261265
+ e.getMessage());

0 commit comments

Comments
 (0)