Skip to content

Commit

Permalink
Make group creation exceptions more accurate.
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie0 committed Feb 17, 2014
1 parent d8e1df9 commit fe03a22
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/org/thoughtcrime/securesms/GroupCreateActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,14 @@ public void onClick(View v) {
private long handleCreatePushGroup(String groupName,
byte[] avatar,
Set<Recipient> members)
throws IOException, InvalidNumberException
throws InvalidNumberException, MmsException
{
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(this);
byte[] groupId = groupDatabase.allocateGroupId();

try {
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(this);
List<String> memberE164Numbers = getE164Numbers(members);
byte[] groupId = groupDatabase.allocateGroupId();
String groupRecipientId = GroupUtil.getEncodedId(groupId);
List<String> memberE164Numbers = getE164Numbers(members);
String groupRecipientId = GroupUtil.getEncodedId(groupId);

String groupActionArguments = GroupUtil.serializeArguments(groupId, groupName, memberE164Numbers);

Expand All @@ -377,9 +378,11 @@ private long handleCreatePushGroup(String groupName,
GroupContext.Type.CREATE_VALUE,
groupActionArguments, avatar);
} catch (RecipientFormattingException e) {
throw new IOException(e);
throw new AssertionError(e);
} catch (MmsException e) {
throw new IOException(e);
Log.w("GroupCreateActivity", e);
groupDatabase.remove(groupId, TextSecurePreferences.getLocalNumber(this));
throw new MmsException(e);
}
}

Expand Down

0 comments on commit fe03a22

Please sign in to comment.