From b70917b1b2384646c4c7b6e202bbfc4de1769124 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 3 Nov 2019 10:13:12 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=8E=A8=20Catch=20and=20log=20exceptions=20?= =?utf8?q?in=20identity=20manager=20thread?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt | 7 +------ .../net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt index 3a71772..f9019d0 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt @@ -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) } } } diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt index 1e83cd7..cb7d0bd 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt @@ -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. */ -- 2.7.4