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 NS_ASSUME_NONNULL_BEGIN
extern NSString *const kContactsUpdaterErrorDomain;
extern const NSInteger kContactsUpdaterRateLimitErrorCode;
@class Contact; @class Contact;
@interface ContactsUpdater : NSObject @interface ContactsUpdater : NSObject

View File

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

View File

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