From c8f819cb9427fa58c81bdd02829aab97a94b7f33 Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 6 Apr 2022 22:09:22 +0200 Subject: [PATCH] Fix output of rate limit exception --- .../main/java/org/asamk/signal/manager/helper/SendHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java index 859dc941..46f34a4d 100644 --- a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java +++ b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java @@ -175,7 +175,7 @@ public class SendHelper { } catch (RateLimitException e) { var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId()); logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage()); - return SendMessageResult.networkFailure(address); + return SendMessageResult.rateLimitFailure(address, e); } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) { var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId()); return SendMessageResult.identityFailure(address, e.getIdentityKey()); @@ -603,7 +603,7 @@ public class SendHelper { return SendMessageResult.proofRequiredFailure(address, e); } catch (RateLimitException e) { logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage()); - return SendMessageResult.networkFailure(address); + return SendMessageResult.rateLimitFailure(address, e); } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) { return SendMessageResult.identityFailure(address, e.getIdentityKey()); } catch (IOException e) {