mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Multi-catch.
This commit is contained in:
@@ -294,11 +294,7 @@ class FeedManagerImpl implements FeedManager, Client, EventListener,
|
||||
for (Feed feed : feeds) {
|
||||
try {
|
||||
newFeeds.add(fetchFeed(feed));
|
||||
} catch (IOException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
newFeeds.add(feed);
|
||||
} catch (DbException e) {
|
||||
} catch (IOException | DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
newFeeds.add(feed);
|
||||
@@ -381,9 +377,7 @@ class FeedManagerImpl implements FeedManager, Client, EventListener,
|
||||
SyndFeedInput input = new SyndFeedInput();
|
||||
try {
|
||||
return input.build(new XmlReader(stream));
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new IOException(e);
|
||||
} catch (FeedException e) {
|
||||
} catch (IllegalArgumentException | FeedException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
@@ -469,13 +463,7 @@ class FeedManagerImpl implements FeedManager, Client, EventListener,
|
||||
BlogPost post = blogPostFactory
|
||||
.createBlogPost(groupId, time, null, localAuthor, body);
|
||||
blogManager.addLocalPost(txn, post);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
} catch (GeneralSecurityException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
} catch (FormatException e) {
|
||||
} catch (DbException | GeneralSecurityException | FormatException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
||||
@@ -134,9 +134,7 @@ class ForumManagerImpl extends BdfIncomingMessageHook implements ForumManager {
|
||||
try {
|
||||
p = forumPostFactory.createPost(groupId, timestamp, parentId,
|
||||
author, body);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (FormatException e) {
|
||||
} catch (GeneralSecurityException | FormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return p;
|
||||
|
||||
@@ -519,9 +519,7 @@ class IntroduceeManager {
|
||||
try {
|
||||
processStateUpdate(txn, null,
|
||||
engine.onLocalAction(state, localAction));
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
} catch (IOException e) {
|
||||
} catch (DbException | IOException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,9 +173,7 @@ class IntroducerManager {
|
||||
try {
|
||||
processStateUpdate(txn,
|
||||
engine.onLocalAction(state, localAction));
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
} catch (IOException e) {
|
||||
} catch (DbException | IOException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,12 +251,7 @@ class IntroductionManagerImpl extends ConversationClientImpl
|
||||
LOG.warning("Unknown role '" + role + "'");
|
||||
throw new DbException();
|
||||
}
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
if (role == ROLE_INTRODUCER) introducerManager.abort(txn, state);
|
||||
else introduceeManager.abort(txn, state);
|
||||
} catch (FormatException e) {
|
||||
// FIXME necessary?
|
||||
} catch (DbException | FormatException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
if (role == ROLE_INTRODUCER) introducerManager.abort(txn, state);
|
||||
else introduceeManager.abort(txn, state);
|
||||
|
||||
@@ -63,9 +63,7 @@ class GroupMessageFactoryImpl implements GroupMessageFactory {
|
||||
Message m = clientHelper.createMessage(groupId, timestamp, body);
|
||||
|
||||
return new GroupMessage(m, null, member);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (FormatException e) {
|
||||
} catch (GeneralSecurityException | FormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -91,9 +89,7 @@ class GroupMessageFactoryImpl implements GroupMessageFactory {
|
||||
Message m = clientHelper.createMessage(groupId, timestamp, body);
|
||||
|
||||
return new GroupMessage(m, parentId, author);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (FormatException e) {
|
||||
} catch (GeneralSecurityException | FormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,9 +324,7 @@ public class TestDataCreatorImpl implements TestDataCreator {
|
||||
.createBlogPost(blog.getId(), timestamp, null, author,
|
||||
body);
|
||||
blogManager.addLocalPost(blogPost);
|
||||
} catch (FormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (GeneralSecurityException e) {
|
||||
} catch (FormatException | GeneralSecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -924,9 +924,7 @@ public class IntroductionIntegrationTest
|
||||
time);
|
||||
}
|
||||
}
|
||||
} catch (DbException exception) {
|
||||
eventWaiter.rethrow(exception);
|
||||
} catch (FormatException exception) {
|
||||
} catch (DbException | FormatException exception) {
|
||||
eventWaiter.rethrow(exception);
|
||||
} finally {
|
||||
eventWaiter.resume();
|
||||
|
||||
Reference in New Issue
Block a user