Fix error type for dbus rate limit challenge

This commit is contained in:
AsamK 2021-11-06 15:41:58 +01:00
parent 2ab42ca547
commit eec7aec069
2 changed files with 3 additions and 5 deletions

View file

@ -1,6 +1,5 @@
package org.asamk;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.Struct;
import org.freedesktop.dbus.annotations.DBusProperty;
@ -166,7 +165,7 @@ public interface Signal extends DBusInterface {
String uploadStickerPack(String stickerPackPath) throws Error.Failure;
void submitRateLimitChallenge(String challenge, String captchaString) throws IOErrorException;
void submitRateLimitChallenge(String challenge, String captchaString) throws Error.Failure;
class MessageReceivedV2 extends DBusSignal {

View file

@ -2,7 +2,6 @@ package org.asamk.signal.dbus;
import org.asamk.Signal;
import org.asamk.signal.BaseConfig;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.manager.AttachmentInvalidException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.NotMasterDeviceException;
@ -90,13 +89,13 @@ public class DbusSignalImpl implements Signal {
}
@Override
public void submitRateLimitChallenge(String challenge, String captchaString) throws IOErrorException {
public void submitRateLimitChallenge(String challenge, String captchaString) {
final var captcha = captchaString == null ? null : captchaString.replace("signalcaptcha://", "");
try {
m.submitRateLimitRecaptchaChallenge(challenge, captcha);
} catch (IOException e) {
throw new IOErrorException("Submit challenge error: " + e.getMessage(), e);
throw new Error.Failure("Submit challenge error: " + e.getMessage());
}
}