Fix output of rate limit exception

This commit is contained in:
AsamK 2022-04-06 22:09:22 +02:00
parent d27a12a6cf
commit c8f819cb94

View file

@ -175,7 +175,7 @@ public class SendHelper {
} catch (RateLimitException e) { } catch (RateLimitException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId()); var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage()); 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) { } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId()); var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());
return SendMessageResult.identityFailure(address, e.getIdentityKey()); return SendMessageResult.identityFailure(address, e.getIdentityKey());
@ -603,7 +603,7 @@ public class SendHelper {
return SendMessageResult.proofRequiredFailure(address, e); return SendMessageResult.proofRequiredFailure(address, e);
} catch (RateLimitException e) { } catch (RateLimitException e) {
logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage()); 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) { } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
return SendMessageResult.identityFailure(address, e.getIdentityKey()); return SendMessageResult.identityFailure(address, e.getIdentityKey());
} catch (IOException e) { } catch (IOException e) {