Added documentation, refined exception handling

This commit is contained in:
2019-12-14 11:30:00 +01:00
parent 0123935cea
commit ac7b7fa3d6
4 changed files with 65 additions and 32 deletions

View File

@ -238,9 +238,8 @@ public class ChatWindow extends JFrame {
contentPane.revalidate();
loadUsersAndChats();
if(client.isOnline())
startSyncThread(Config.getInstance().getSyncTimeout());
if (client.isOnline()) startSyncThread(Config.getInstance().getSyncTimeout());
contentPane.revalidate();
}
@ -342,7 +341,11 @@ public class ChatWindow extends JFrame {
new Thread(() -> {
// Synchronize
localDB.applySync(client.sendSync(client.getSender().getID(), localDB.fillSync(client.getSender().getID())));
try {
localDB.applySync(client.sendSync(client.getSender().getID(), localDB.fillSync(client.getSender().getID())));
} catch (Exception e) {
logger.log(Level.SEVERE, "Could not perform sync", e);
}
// Process unread messages
localDB.addUnreadMessagesToLocalDB();