mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Convert RateLimitException to a network failure send message result
This commit is contained in:
parent
6ac4af4974
commit
74e576c907
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
|
||||||
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
||||||
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.ProofRequiredException;
|
import org.whispersystems.signalservice.api.push.exceptions.ProofRequiredException;
|
||||||
|
import org.whispersystems.signalservice.api.push.exceptions.RateLimitException;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -285,6 +286,9 @@ public class SendHelper {
|
||||||
}
|
}
|
||||||
} catch (ProofRequiredException e) {
|
} catch (ProofRequiredException e) {
|
||||||
return SendMessageResult.proofRequiredFailure(address, e);
|
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);
|
||||||
} 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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue