Added a path for error handling when fetching data from the ZeroTier daemon
Still need to wire up error messages to the user.
This commit is contained in:
@@ -74,13 +74,21 @@ NSString * const StatusUpdateKey = @"com.zerotier.one.status";
|
||||
}
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
|
||||
[[ServiceCom sharedInstance] getNetworklist:^(NSArray<Network *> *networkList) {
|
||||
_receivedNetworks = networkList;
|
||||
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
[self internal_updateNetworkInfo];
|
||||
}];
|
||||
}];
|
||||
} ];
|
||||
} error:&error];
|
||||
|
||||
if(error) {
|
||||
// TODO: Display error message
|
||||
|
||||
[self stop];
|
||||
}
|
||||
|
||||
[[ServiceCom sharedInstance] getNodeStatus:^(NodeStatus *status) {
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:status forKey:@"status"];
|
||||
@@ -90,7 +98,13 @@ NSString * const StatusUpdateKey = @"com.zerotier.one.status";
|
||||
object:nil
|
||||
userInfo:userInfo];
|
||||
}];
|
||||
}];
|
||||
} error:&error];
|
||||
|
||||
if (error) {
|
||||
// TODO: Display error message
|
||||
|
||||
[self stop];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)deleteSavedNetwork:(NSString*)networkId
|
||||
|
||||
Reference in New Issue
Block a user