Improve logging around decryption exceptions.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-03-21 15:35:04 -04:00
parent cdef86e276
commit 7f681e964b
3 changed files with 11 additions and 5 deletions

View file

@ -710,7 +710,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)processException:(NSException *)exception envelope:(OWSSignalServiceProtosEnvelope *)envelope
{
OWSAssert([NSThread isMainThread]);
DDLogError(@"%@ Got exception: %@ of type: %@", self.tag, exception.description, exception.name);
DDLogError(@"%@ Got exception: %@ of type: %@ with reason: %@",
self.tag,
exception.description,
exception.name,
exception.reason);
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
TSErrorMessage *errorMessage;

View file

@ -55,8 +55,9 @@
[self preKeyRecordForKey:[self keyFromInt:preKeyId] inCollection:TSStorageManagerPreKeyStoreCollection];
if (!preKeyRecord) {
@throw
[NSException exceptionWithName:InvalidKeyIdException reason:@"No key found matching key id" userInfo:@{}];
@throw [NSException exceptionWithName:InvalidKeyIdException
reason:@"No pre key found matching key id"
userInfo:@{}];
} else {
return preKeyRecord;
}

View file

@ -38,8 +38,9 @@ NSString *const TSStorageManagerKeyPrekeyCurrentSignedPrekeyId = @"currentSigned
inCollection:TSStorageManagerSignedPreKeyStoreCollection];
if (!preKeyRecord) {
@throw
[NSException exceptionWithName:InvalidKeyIdException reason:@"No key found matching key id" userInfo:@{}];
@throw [NSException exceptionWithName:InvalidKeyIdException
reason:@"No signed pre key found matching key id"
userInfo:@{}];
} else {
return preKeyRecord;
}