Tag: Stacktrace
How to Get Necessary Information from the Exception in C# ?
There are times when you want to get the necessary information from the exception to identify the error better in C# . The Exception class contains various properties which can be used to retreive the necessary information from the error. Some of the properties includes Message – The Message property provides the brief description of error. Source – The Source property provides information about the…
How to rethrow InnnerException without losing Stack Trace in C# ?
Microsoft .NET Framework 4.5 introduced the ExceptionDispatchInfo class which lets the developers to capture an exception and rethrow it without losing the stack trace. How to rethrow InnnerException without losing Stack Trace in C# ? Below is a sample code snippet demonstrating the usage of this class.