mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-22 23:59:54 +01:00
Move nested try block into private method.
This commit is contained in:
@@ -44,6 +44,16 @@ class OwnMailboxConnectivityChecker extends ConnectivityCheckerImpl {
|
|||||||
if (!properties.isOwner()) throw new IllegalArgumentException();
|
if (!properties.isOwner()) throw new IllegalArgumentException();
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
|
return checkConnectivityAndStoreResult(properties);
|
||||||
|
} catch (DbException e) {
|
||||||
|
logException(LOG, WARNING, e);
|
||||||
|
return true; // Retry
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkConnectivityAndStoreResult(
|
||||||
|
MailboxProperties properties) throws DbException {
|
||||||
try {
|
try {
|
||||||
mailboxApi.getFolders(properties);
|
mailboxApi.getFolders(properties);
|
||||||
LOG.info("Own mailbox is reachable");
|
LOG.info("Own mailbox is reachable");
|
||||||
@@ -60,11 +70,6 @@ class OwnMailboxConnectivityChecker extends ConnectivityCheckerImpl {
|
|||||||
db.transaction(false, txn -> mailboxSettingsManager
|
db.transaction(false, txn -> mailboxSettingsManager
|
||||||
.recordFailedConnectionAttempt(txn, now));
|
.recordFailedConnectionAttempt(txn, now));
|
||||||
}
|
}
|
||||||
} catch (DbException e) {
|
|
||||||
logException(LOG, WARNING, e);
|
|
||||||
}
|
|
||||||
return true; // Retry
|
return true; // Retry
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user