1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Improve decryption failure logging (#2453)

* Improve typing

* Log the actual errors to include call stacks
This commit is contained in:
Michael Telatynski
2022-06-13 13:26:01 +01:00
committed by GitHub
parent aaf508e309
commit 4897bccdc9
5 changed files with 14 additions and 13 deletions

View File

@@ -823,18 +823,13 @@ export class MatrixEvent extends TypedEventEmitter<EmittedEvents, MatrixEventHan
//
if (this.retryDecryption) {
// decryption error, but we have a retry queued.
logger.log(
`Got error decrypting event (id=${this.getId()}: ` +
`${e}), but retrying`,
);
logger.log(`Got error decrypting event (id=${this.getId()}: ${e.detailedString}), but retrying`, e);
continue;
}
// decryption error, no retries queued. Warn about the error and
// set it to m.bad.encrypted.
logger.warn(
`Error decrypting event (id=${this.getId()}): ${e.detailedString}`,
);
logger.warn(`Got error decrypting event (id=${this.getId()}: ${e.detailedString})`, e);
res = this.badEncryptedMessage(e.message);
}