Rework concurrency in the signaling logic.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 6521a80c44
commit ddbc4819f1

@ -436,7 +436,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
}
if ([exception.name isEqualToString:OWSMessageSenderRateLimitedException]) {
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeSingalServiceRateLimited,
NSError *error = OWSErrorWithCodeDescription(OWSErrorCodeSignalServiceRateLimited,
NSLocalizedString(@"FAILED_SENDING_BECAUSE_RATE_LIMIT",
@"action sheet header when re-sending message which failed because of too many attempts"));
return failureHandler(error);

@ -18,7 +18,8 @@ typedef NS_ENUM(NSInteger, OWSErrorCode) {
OWSErrorCodeFailedToDecryptMessage = 100,
OWSErrorCodeFailedToEncryptMessage = 110,
OWSErrorCodeSignalServiceFailure = 1001,
OWSErrorCodeSingalServiceRateLimited = 1010,
OWSErrorCodeSignalServiceRateLimited = 1010,
OWSErrorCodeWebRTCMissingDataChannel = 1011,
OWSErrorCodeUserError = 2001,
};
@ -27,5 +28,6 @@ extern NSError *OWSErrorMakeUnableToProcessServerResponseError();
extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError();
extern NSError *OWSErrorMakeNoSuchSignalRecipientError();
extern NSError *OWSErrorMakeAssertionError();
extern NSError *OWSErrorMakeWebRTCMissingDataChannelError();
NS_ASSUME_NONNULL_END

@ -1,4 +1,6 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSError.h"
@ -35,7 +37,13 @@ NSError *OWSErrorMakeNoSuchSignalRecipientError()
NSError *OWSErrorMakeAssertionError()
{
return OWSErrorWithCodeDescription(OWSErrorCodeFailedToSendOutgoingMessage,
NSLocalizedString(@"ERROR_DESCRIPTION_UNKNOWN_ERROR", @"Worst case generic error message"));
NSLocalizedString(@"ERROR_DESCRIPTION_UNKNOWN_ERROR", @"Worst case generic error message"));
}
NSError *OWSErrorMakeWebRTCMissingDataChannelError()
{
return OWSErrorWithCodeDescription(OWSErrorCodeWebRTCMissingDataChannel,
NSLocalizedString(@"ERROR_DESCRIPTION_WEBRTC_MISSING_DATA_CHANNEL", @"Missing data channel while trying to sending message"));
}
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save