Respond to CR.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-04-13 15:36:59 -04:00
parent 00f1b53e61
commit 715e9e85ff
3 changed files with 3 additions and 10 deletions

View File

@ -6,9 +6,6 @@
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kContactsUpdaterErrorDomain;
extern const NSInteger kContactsUpdaterRateLimitErrorCode;
@class Contact;
@interface ContactsUpdater : NSObject

View File

@ -14,9 +14,6 @@
NS_ASSUME_NONNULL_BEGIN
NSString *const kContactsUpdaterErrorDomain = @"kContactsUpdaterErrorDomain";
const NSInteger kContactsUpdaterRateLimitErrorCode = 413;
@implementation ContactsUpdater
+ (instancetype)sharedUpdater {
@ -211,10 +208,8 @@ const NSInteger kContactsUpdaterRateLimitErrorCode = 413;
failure:^(NSURLSessionDataTask *task, NSError *error) {
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
if (response.statusCode == 413) {
NSString *const kContactsUpdaterErrorDomain = @"kContactsUpdaterErrorDomain";
failure([NSError errorWithDomain:kContactsUpdaterErrorDomain
code:kContactsUpdaterRateLimitErrorCode
userInfo:nil]);
failure(OWSErrorWithCodeDescription(
OWSErrorCodeContactsUpdaterRateLimit, OWSSignalServiceKitErrorDomain));
} else {
failure(error);
}

View File

@ -23,6 +23,7 @@ typedef NS_ENUM(NSInteger, OWSErrorCode) {
OWSErrorCodeNoSuchSignalRecipient = 777404,
OWSErrorCodeMessageSendDisabledDueToPreKeyUpdateFailures = 777405,
OWSErrorCodeMessageSendFailedToBlockList = 777406,
OWSErrorCodeContactsUpdaterRateLimit = 777407,
};
extern NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description);