🎨 Catch and log exceptions in identity manager thread
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 3 Nov 2019 09:13:12 +0000 (10:13 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 3 Nov 2019 09:13:12 +0000 (10:13 +0100)
src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt
src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt

index 3a71772..f9019d0 100644 (file)
@@ -48,12 +48,7 @@ class IdentityLoader @Inject constructor(private val webOfTrustConnector: WebOfT
                                                } else {
                                                        logger.fine { "Loading trusted identities for $ownIdentity from WoT..." }
                                                        time({ stopwatch, identities -> "Loaded ${identities.size} identities for ${ownIdentity.nickname} in ${stopwatch.elapsed(MILLISECONDS) / 1000.0}s." }) {
-                                                               try {
-                                                                       webOfTrustConnector.loadTrustedIdentities(ownIdentity, context?.context)
-                                                               } catch (e: Exception) {
-                                                                       logger.warning { "Caught $e on loading trusted identities for $ownIdentity."}
-                                                                       throw e
-                                                               }
+                                                               webOfTrustConnector.loadTrustedIdentities(ownIdentity, context?.context)
                                                        }
                                                }
                                        }
index 1e83cd7..cb7d0bd 100644 (file)
@@ -69,6 +69,8 @@ class IdentityManagerImpl @Inject constructor(
                                }
                        } catch (wote1: WebOfTrustException) {
                                logger.log(Level.WARNING, "WoT has disappeared!", wote1)
+                       } catch (e: Exception) {
+                               logger.log(Level.SEVERE, "Uncaught exception in IdentityManager thread!", e)
                        }
 
                        /* wait a minute before checking again. */