Guard main thread packet handling
This commit is contained in:
parent
1f5b6aea97
commit
d444e01b37
|
@ -33,7 +33,14 @@ public class PacketThreadUtilMixin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (processor.getConnection().isConnected()) {
|
if (processor.getConnection().isConnected()) {
|
||||||
|
try {
|
||||||
packetIn.handle(processor);
|
packetIn.handle(processor);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
if (processor.shouldPropagateHandlingExceptions()) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
LOGGER.error("Failed to handle packet {}, suppressing error", packetIn, exception);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("Ignoring packet due to disconnection: " + packetIn);
|
LOGGER.debug("Ignoring packet due to disconnection: " + packetIn);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user