diff --git a/Labyrinth.Server/src/main/java/labyrinth/server/messaging/MessageService.java b/Labyrinth.Server/src/main/java/labyrinth/server/messaging/MessageService.java index e5c685f..116cc93 100644 --- a/Labyrinth.Server/src/main/java/labyrinth/server/messaging/MessageService.java +++ b/Labyrinth.Server/src/main/java/labyrinth/server/messaging/MessageService.java @@ -27,8 +27,8 @@ public void sendToSession(WebSocketSession session, Object payload) { synchronized (session) { session.sendMessage(new TextMessage(jsonPayload)); } - } catch (IOException e) { - log.error("IOException at sendToSession (SessionId: {}).", session.getId(), e); + } catch (IOException | IllegalStateException e) { + log.error("Error at sendToSession (SessionId: {}).", session.getId(), e); } } } @@ -41,8 +41,8 @@ public void sendToPlayer(UUID playerId, Object payload) { synchronized (session) { session.sendMessage(new TextMessage(jsonPayload)); } - } catch (IOException e) { - log.error("IOException at sendToPlayer (SessionId: {}).", session.getId(), e); + } catch (IOException | IllegalStateException e) { + log.error("Error at sendToPlayer (SessionId: {}).", session.getId(), e); } } } @@ -63,8 +63,8 @@ public void broadcastToPlayers(Object payload) { synchronized (session) { session.sendMessage(textMessage); } - } catch (IOException e) { - log.error("IOException at broadcastToPlayers (SessionId: {}).", session.getId(), e); + } catch (IOException | IllegalStateException e) { + log.error("Error at broadcastToPlayers (SessionId: {}).", session.getId(), e); } } }