Created
September 18, 2016 22:03
-
-
Save mvacha/8cb333bfd9554bd051aa94748e18d93f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try | |
| { | |
| var res = await _connectedTCS.Task; | |
| if (res.Result) | |
| { | |
| var res2 = await _userStatusTCS.Task; | |
| if (res2.Result) | |
| { | |
| var res3 = await _profileTCS.Task; | |
| if (res3.Result) | |
| { | |
| //success | |
| Log.Info("Connecting to the Gateway successful"); | |
| connectedSuccessfully = true; | |
| RootNode = _profileTCS.Task.Result.Value; | |
| } | |
| else | |
| { | |
| Log.Error("Error when connecting to the Gateway " + res3.Error); | |
| connectedEvent.Set(); | |
| } | |
| } | |
| else | |
| { | |
| Log.Error("Error when connecting to the Gateway " + res2.Error); | |
| connectedEvent.Set(); | |
| } | |
| } | |
| else | |
| { | |
| Log.Error("Error when connecting to the Gateway " + res1.Error); | |
| connectedEvent.Set(); | |
| } | |
| } | |
| catch (AggregateException ex) when (ex.InnerExceptions.Any(e => e is TaskCanceledException)) | |
| { | |
| Log.Error("Error when connecting to the Gateway " + "Task cancelled"); | |
| connectedEvent.Set(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment