diff options
Diffstat (limited to 'Juick/APIClient.m')
-rw-r--r-- | Juick/APIClient.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Juick/APIClient.m b/Juick/APIClient.m index 869e944..e2ef67d 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -67,7 +67,10 @@ } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@"REST Error: %@", error); [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - callback(nil, error); + NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode; + if (statusCode == 401) { + callback(nil, [NSError errorWithDomain:@"JuickErrorDomain" code:401 userInfo:nil]); + } }]; }]; }]; |