Some changes to logging and exception handling.

This commit is contained in:
LevelX2 2014-08-11 00:56:08 +02:00
parent 8c6893a8e8
commit 7992e654ff
4 changed files with 54 additions and 38 deletions

View file

@ -116,9 +116,14 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {
matchView = matchList;
List<UsersView> users = new ArrayList<>();
for (User user : UserManager.getInstance().getUsers()) {
StringBuilder sb = new StringBuilder(user.getGameInfo());
users.add(new UsersView(user.getName(), user.getInfo(), sb.toString()));
try {
users.add(new UsersView(user.getName(), user.getInfo(), user.getGameInfo()));
} catch (Exception ex) {
logger.fatal("User update exception: " + user.getName() + " - " + ex.toString(), ex);
users.add(new UsersView(user.getName(), user.getInfo(), "[exception]"));
}
}
Collections.sort(users, new UserNameSorter());
usersView = users;
}