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; package org.asamk;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.freedesktop.dbus.DBusPath; import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.Struct; import org.freedesktop.dbus.Struct;
import org.freedesktop.dbus.annotations.DBusProperty; import org.freedesktop.dbus.annotations.DBusProperty;
@ -166,7 +165,7 @@ public interface Signal extends DBusInterface {
String uploadStickerPack(String stickerPackPath) throws Error.Failure; 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 { class MessageReceivedV2 extends DBusSignal {

View file

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