mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-28 18:10:38 +00:00
Show better error message when sending fails due to missing pre keys
This commit is contained in:
parent
3180eba836
commit
887ed3bb44
1 changed files with 8 additions and 2 deletions
|
@ -250,8 +250,14 @@ public class SendCommand implements JsonRpcLocalCommand {
|
|||
: m.sendMessage(message, recipientIdentifiers, notifySelf);
|
||||
outputResult(outputWriter, results);
|
||||
} catch (AttachmentInvalidException | IOException e) {
|
||||
throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()
|
||||
.getSimpleName() + ")", e);
|
||||
if (e instanceof IOException io && io.getMessage().contains("No prekeys available")) {
|
||||
throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()
|
||||
.getSimpleName() + "), maybe one of the devices of the recipient wasn't online for a while.",
|
||||
e);
|
||||
} else {
|
||||
throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()
|
||||
.getSimpleName() + ")", e);
|
||||
}
|
||||
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
|
||||
throw new UserErrorException(e.getMessage());
|
||||
} catch (UnregisteredRecipientException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue