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:
Grant Limberg
2016-08-30 20:28:52 -07:00
parent 35d5ed9c2b
commit c2a01f6db4
6 changed files with 129 additions and 33 deletions

View File

@@ -72,10 +72,17 @@ NSString * const JoinedNetworksKey = @"com.zerotier.one.joined-networks";
- (IBAction)onJoinClicked:(id)sender {
NSString *networkId = self.network.stringValue;
NSError *error = nil;
[[ServiceCom sharedInstance] joinNetwork:networkId
allowManaged:(self.allowManagedCheckBox.state == NSOnState)
allowGlobal:(self.allowGlobalCheckBox.state == NSOnState)
allowDefault:(self.allowDefaultCheckBox.state == NSOnState)];
allowDefault:(self.allowDefaultCheckBox.state == NSOnState)
error:&error];
if(error) {
// TODO: display error message
return;
}
self.network.stringValue = @"";