Commit c8f04698 by Dima Bart

Reorder methods.

parent b28b83ec
......@@ -80,6 +80,8 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
@implementation BUYClient
#pragma mark - Init
- (instancetype)init {
BUYAssert(NO, @"BUYClient must be initialized using the designated initializer.");
return nil;
......@@ -248,18 +250,6 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
}];
}
#pragma mark - Helpers
- (NSError *)extractErrorFromResponse:(NSURLResponse *)response json:(NSDictionary *)json
{
NSError *error = nil;
NSInteger statusCode = [((NSHTTPURLResponse *) response) statusCode];
if (statusCode < kMinSuccessfulStatusCode || statusCode > kMaxSuccessfulStatusCode) {
error = [NSError errorWithDomain:NSURLErrorDomain code:statusCode userInfo:json];
}
return error;
}
#pragma mark - URL Components
- (NSURLComponents *)URLComponentsForChannelsAppendingPath:(NSString *)appendingPath queryItems:(NSDictionary*)queryItems
......@@ -555,6 +545,16 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
return [[NSError alloc] initWithDomain:kShopifyError code:statusCode userInfo:errorDictionary];
}
- (NSError *)extractErrorFromResponse:(NSURLResponse *)response json:(NSDictionary *)json
{
NSError *error = nil;
NSInteger statusCode = [((NSHTTPURLResponse *) response) statusCode];
if (statusCode < kMinSuccessfulStatusCode || statusCode > kMaxSuccessfulStatusCode) {
error = [NSError errorWithDomain:NSURLErrorDomain code:statusCode userInfo:json];
}
return error;
}
#pragma mark - Convenience Requests
- (NSURLSessionDataTask *)getRequestForURL:(NSURL *)url completionHandler:(void (^)(NSDictionary *json, NSURLResponse *response, NSError *error))completionHandler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment