Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 34a404f589
commit 68241e8a0a

@ -391,22 +391,15 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
aborted = YES;
return completion(NO);
}
SignalIOSProtoBackupSnapshot *_Nullable entities;
@try {
NSError *error;
entities = [SignalIOSProtoBackupSnapshot parseData:uncompressedData error:&error];
SignalIOSProtoBackupSnapshot *_Nullable entities =
[SignalIOSProtoBackupSnapshot parseData:uncompressedData error:&error];
if (!entities || error) {
DDLogError(@"%@ could not parse proto: %@.", self.logTag, error);
// Database-related errors are unrecoverable.
aborted = YES;
return completion(NO);
}
} @catch (NSException *exception) {
OWSProdLogAndFail(@"%@ Could not parse proto: %@", self.logTag, exception.debugDescription);
// TODO: Add analytics.
aborted = YES;
return completion(NO);
}
if (!entities || entities.entity.count < 1) {
DDLogError(@"%@ missing entities.", self.logTag);
// Database-related errors are unrecoverable.

@ -328,11 +328,9 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
AssertOnDispatchQueue(self.serialQueue);
OWSAssert(job);
SSKProtoEnvelope *_Nullable envelope = nil;
@try {
envelope = job.envelopeProto;
} @catch (NSException *exception) {
OWSProdLogAndFail(@"%@ Could not parse proto: %@", self.logTag, exception.debugDescription);
SSKProtoEnvelope *_Nullable envelope = job.envelopeProto;
if (!envelope) {
OWSProdLogAndFail(@"%@ Could not parse proto.", self.logTag);
// TODO: Add analytics.
[[OWSPrimaryStorage.sharedManager newDatabaseConnection]

@ -698,19 +698,12 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_
// If we receive a response, we know we're not de-registered.
[TSAccountManager.sharedInstance setIsDeregistered:NO];
WebSocketProtoWebSocketMessage *_Nullable wsMessage;
@try {
NSError *error;
wsMessage = [WebSocketProtoWebSocketMessage parseData:data error:&error];
WebSocketProtoWebSocketMessage *_Nullable wsMessage = [WebSocketProtoWebSocketMessage parseData:data error:&error];
if (!wsMessage || error) {
OWSFail(@"%@ could not parse proto: %@", self.logTag, error);
return;
}
} @catch (NSException *exception) {
OWSProdLogAndFail(@"%@ Received an invalid message: %@", self.logTag, exception.debugDescription);
// TODO: Add analytics.
return;
}
if (wsMessage.type == WebSocketProtoWebSocketMessageTypeRequest) {
[self processWebSocketRequestMessage:wsMessage.request];

@ -93,9 +93,8 @@ static uint32_t const OWSFingerprintDefaultHashIterations = 5200;
OWSAssert(data.length > 0);
OWSAssert(error);
FingerprintProtoLogicalFingerprints *logicalFingerprints;
@try {
*error = nil;
FingerprintProtoLogicalFingerprints *_Nullable logicalFingerprints;
logicalFingerprints = [FingerprintProtoLogicalFingerprints parseData:data error:error];
if (!logicalFingerprints || *error) {
OWSFail(@"%@ fingerprint failure: %@", self.logTag, *error);
@ -104,11 +103,6 @@ static uint32_t const OWSFingerprintDefaultHashIterations = 5200;
*error = OWSErrorWithCodeDescription(OWSErrorCodePrivacyVerificationFailure, description);
return NO;
}
} @catch (NSException *exception) {
// Sync log in case we bail.
DDLogError(@"%@ parsing QRCode data failed with error: %@", self.logTag, exception);
@throw exception;
}
if (logicalFingerprints.version < OWSFingerprintScannableFormatVersion) {
DDLogWarn(@"%@ Verification failed. They're running an old version.", self.logTag);

Loading…
Cancel
Save