Exception Message Concatener allows to get all the Inner Exceptions Messages from an Exception. You can return a new Exception or just all messages combined in one string.
- Open the Nuget Package Manager Console
- Install-Package ExceptionMsgConcatener
- Or from the Nuget Package Manager search for ExceptionMsgConcatener and install it from there
Example #1:
var innerException = new Exception("There was another error");
var exception = new Exception("There was an error", innerException);
var newException = ExceptionMsgConcatener.ExceptionToException(exception);
Console.WriteLine(newException.Message);
// Outputs
// "There was an error, There was another error"
Example #2:
var innerException = new Exception("There was another error");
var exception = new Exception("There was an error", innerException);
var newExceptionMessage = ExceptionMsgConcatener.ExceptionToString(exception);
Console.WriteLine(newExceptionMessage);
// Outputs
// "There was an error, There was another error"
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT License