Created
October 31, 2020 13:32
-
-
Save joao-r-reis/50e69c41d6a9d05c3c7b72a66fd96883 to your computer and use it in GitHub Desktop.
TryCatch.cs
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
ISession session; | |
try | |
{ | |
session = cluster.Connect(); | |
} | |
catch (NoHostAvailableException ex) | |
{ | |
var innerExceptions = ex.Errors.Select( | |
kvp => $"Host: {kvp.Key}; Message: {kvp.Value.Message}; StackTrace: {kvp.Value.StackTrace}"); | |
log.Error($"{ex.Message};{innerExceptions}"); | |
throw; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment