Remove error handling for oracle unlimited crypto issue

This commit is contained in:
AsamK 2021-05-01 08:45:10 +02:00
parent 0a63dd1db4
commit 357e278f48
11 changed files with 5 additions and 65 deletions

View file

@ -16,8 +16,6 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class AddDeviceCommand implements LocalCommand {
private final static Logger logger = LoggerFactory.getLogger(AddDeviceCommand.class);
@ -41,9 +39,6 @@ public class AddDeviceCommand implements LocalCommand {
} catch (InvalidKeyException e) {
logger.error("Add device link failed", e);
throw new UnexpectedErrorException("Add device link failed.");
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
}
}
}

View file

@ -16,7 +16,6 @@ import org.whispersystems.signalservice.internal.push.exceptions.GroupPatchNotAc
import java.io.IOException;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
public class JoinGroupCommand implements LocalCommand {
@ -53,9 +52,6 @@ public class JoinGroupCommand implements LocalCommand {
writer.println("Joined group \"{}\"", newGroupId.toBase64());
}
handleTimestampAndSendMessageResults(writer, 0, results.second());
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (GroupPatchNotAcceptedException e) {
throw new UserErrorException("Failed to join group, maybe already a member");
} catch (IOException e) {

View file

@ -17,8 +17,6 @@ import org.whispersystems.libsignal.InvalidKeyException;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class LinkCommand implements ProvisioningCommand {
private final static Logger logger = LoggerFactory.getLogger(LinkCommand.class);
@ -45,9 +43,6 @@ public class LinkCommand implements ProvisioningCommand {
throw new UserErrorException("Link request timed out, please try again.");
} catch (IOException e) {
throw new IOErrorException("Link request error: " + e.getMessage());
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (InvalidKeyException e) {
logger.debug("Finish device link failed", e);
throw new UnexpectedErrorException("Invalid key: " + e.getMessage());

View file

@ -16,7 +16,6 @@ import org.asamk.signal.util.Util;
import java.io.IOException;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
public class QuitGroupCommand implements LocalCommand {
@ -42,12 +41,7 @@ public class QuitGroupCommand implements LocalCommand {
handleTimestampAndSendMessageResults(writer, results.first(), results.second());
} catch (IOException e) {
throw new IOErrorException("Failed to send message: " + e.getMessage());
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (GroupNotFoundException e) {
throw new UserErrorException("Failed to send to group: " + e.getMessage());
} catch (NotAGroupMemberException e) {
} catch (GroupNotFoundException | NotAGroupMemberException e) {
throw new UserErrorException("Failed to send to group: " + e.getMessage());
}
}

View file

@ -27,8 +27,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
private final static Logger logger = LoggerFactory.getLogger(ReceiveCommand.class);
@ -169,9 +167,6 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
handler);
} catch (IOException e) {
throw new IOErrorException("Error while receiving messages: " + e.getMessage());
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
}
}
}

View file

@ -15,8 +15,6 @@ import org.freedesktop.dbus.exceptions.DBusExecutionException;
import java.util.List;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class RemoteDeleteCommand implements DbusCommand {
@Override
@ -26,10 +24,8 @@ public class RemoteDeleteCommand implements DbusCommand {
.required(true)
.type(long.class)
.help("Specify the timestamp of the message to delete.");
subparser.addArgument("-g", "--group")
.help("Specify the recipient group ID.");
subparser.addArgument("recipient")
.help("Specify the recipients' phone number.").nargs("*");
subparser.addArgument("-g", "--group").help("Specify the recipient group ID.");
subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*");
}
@Override
@ -66,9 +62,6 @@ public class RemoteDeleteCommand implements DbusCommand {
timestamp = signal.sendRemoteDeleteMessage(targetTimestamp, recipients);
}
writer.println("{}", timestamp);
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (UnknownObject e) {
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
} catch (Signal.Error.InvalidNumber e) {

View file

@ -22,8 +22,6 @@ import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class SendCommand implements DbusCommand {
private final static Logger logger = LoggerFactory.getLogger(SendCommand.class);
@ -67,9 +65,6 @@ public class SendCommand implements DbusCommand {
try {
signal.sendEndSessionMessage(recipients);
return;
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (Signal.Error.UntrustedIdentity e) {
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
} catch (DBusExecutionException e) {
@ -105,9 +100,6 @@ public class SendCommand implements DbusCommand {
var timestamp = signal.sendGroupMessage(messageText, attachments, groupId);
writer.println("{}", timestamp);
return;
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (DBusExecutionException e) {
throw new UnexpectedErrorException("Failed to send group message: " + e.getMessage());
}
@ -118,9 +110,6 @@ public class SendCommand implements DbusCommand {
var timestamp = signal.sendNoteToSelfMessage(messageText, attachments);
writer.println("{}", timestamp);
return;
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (Signal.Error.UntrustedIdentity e) {
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
} catch (DBusExecutionException e) {
@ -131,9 +120,6 @@ public class SendCommand implements DbusCommand {
try {
var timestamp = signal.sendMessage(messageText, attachments, recipients);
writer.println("{}", timestamp);
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (UnknownObject e) {
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
} catch (Signal.Error.UntrustedIdentity e) {

View file

@ -16,8 +16,6 @@ import org.freedesktop.dbus.exceptions.DBusExecutionException;
import java.util.List;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class SendReactionCommand implements DbusCommand {
@Override
@ -75,9 +73,6 @@ public class SendReactionCommand implements DbusCommand {
timestamp = signal.sendMessageReaction(emoji, isRemove, targetAuthor, targetTimestamp, recipients);
}
writer.println("{}", timestamp);
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (UnknownObject e) {
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
} catch (Signal.Error.InvalidNumber e) {

View file

@ -18,8 +18,6 @@ import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
public class UpdateGroupCommand implements DbusCommand {
private final static Logger logger = LoggerFactory.getLogger(UpdateGroupCommand.class);
@ -67,9 +65,6 @@ public class UpdateGroupCommand implements DbusCommand {
if (groupId.length != newGroupId.length) {
writer.println("Created new group: \"{}\"", Base64.getEncoder().encodeToString(newGroupId));
}
} catch (AssertionError e) {
handleAssertionError(e);
throw e;
} catch (Signal.Error.AttachmentInvalid e) {
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
} catch (DBusExecutionException e) {

View file

@ -17,10 +17,6 @@ public class ErrorUtils {
private ErrorUtils() {
}
public static void handleAssertionError(AssertionError e) {
logger.warn("If you use an Oracle JRE please check if you have unlimited strength crypto enabled, see README");
}
public static void handleTimestampAndSendMessageResults(
PlainTextWriter writer, long timestamp, List<SendMessageResult> results
) throws CommandException {