diff options
author | Vitaly Takmazov | 2019-03-22 00:33:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-22 00:33:30 +0300 |
commit | 5f4a09ec689cb04ce71b4eb7425936f04a70f6f4 (patch) | |
tree | 9653dc543bd8f47dbfa853cd36ace63206efc983 /Juick/APIClient.m | |
parent | 6e49fc5c4273e7597925c133c3a6985b6ad85ecc (diff) |
Fix sign in
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]); + } }]; }]; }]; |