- ownIdentities.associateWith { ownIdentity ->
- if (ownIdentity.doesNotHaveCorrectContext()) {
- emptySet()
- } else {
- time({ stopwatch, identities -> "Loaded ${identities.size} identities for ${ownIdentity.nickname} in ${stopwatch.elapsed(MILLISECONDS) / 1000.0}s." }) {
- webOfTrustConnector.loadTrustedIdentities(ownIdentity, context?.context)
+ ownIdentities
+ .also { logger.fine { "Getting trusted identities for ${it.size} own identities..." } }
+ .associateWith { ownIdentity ->
+ logger.fine { "Getting trusted identities for $ownIdentity..." }
+ if (ownIdentity.doesNotHaveCorrectContext()) {
+ logger.fine { "Skipping $ownIdentity because of incorrect context." }
+ emptySet()
+ } 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
+ }
+ }
+ }