]> nmode's Git Repositories - signal-cli/commitdiff
Add verbose logging for decryption errors of incoming messages
authorAsamK <asamk@gmx.de>
Sun, 2 Jan 2022 20:19:37 +0000 (21:19 +0100)
committerAsamK <asamk@gmx.de>
Sun, 2 Jan 2022 20:36:43 +0000 (21:36 +0100)
lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java

index 67e45516bad737e2611aef6ba6e6a1238af25031..d5ada09ee32f4dc662a8791f42a8c79fc23dbbfa 100644 (file)
@@ -119,6 +119,7 @@ public final class IncomingMessageHandler {
                 exception = new UntrustedIdentityException(account.getRecipientStore()
                         .resolveRecipientAddress(recipientId), e.getSenderDevice());
             } catch (ProtocolInvalidKeyIdException | ProtocolInvalidKeyException | ProtocolNoSessionException | ProtocolInvalidMessageException e) {
                 exception = new UntrustedIdentityException(account.getRecipientStore()
                         .resolveRecipientAddress(recipientId), e.getSenderDevice());
             } catch (ProtocolInvalidKeyIdException | ProtocolInvalidKeyException | ProtocolNoSessionException | ProtocolInvalidMessageException e) {
+                logger.debug("Failed to decrypt incoming message", e);
                 final var sender = account.getRecipientStore().resolveRecipient(e.getSender());
                 final var senderProfile = context.getProfileHelper().getRecipientProfile(sender);
                 final var selfProfile = context.getProfileHelper().getRecipientProfile(account.getSelfRecipientId());
                 final var sender = account.getRecipientStore().resolveRecipient(e.getSender());
                 final var senderProfile = context.getProfileHelper().getRecipientProfile(sender);
                 final var selfProfile = context.getProfileHelper().getRecipientProfile(account.getSelfRecipientId());
@@ -138,6 +139,7 @@ public final class IncomingMessageHandler {
                 logger.debug("Dropping unidentified message from self.");
                 return new Pair<>(List.of(), null);
             } catch (Exception e) {
                 logger.debug("Dropping unidentified message from self.");
                 return new Pair<>(List.of(), null);
             } catch (Exception e) {
+                logger.debug("Failed to handle incoming message", e);
                 exception = e;
             }
         }
                 exception = e;
             }
         }