Inner Exception in C# with Examples | CSharp Inner Exception
Inner Exception in C# with Examples | CSharp Inner Exception In this video, I am going to discuss the Inner Exception in C# with Examples. At the end of this video, you will understand what is Inner Exception and its need in C#. What is Inner Exception in C#? The Inner Exception in C# is a property of the Exception class. If you go to the definition of the Exception class, then you will see that it is a read-only property i.e. having only get accessor as shown in the below image. As this property is defined in the parent Exception class, so, this property is available to all the Child classes including the Custom Exception classes. public Exception InnerException {get;}: This InnerException property gets the Exception instance that caused the current exception. It returns an object that describes the error that caused the current exception. The InnerException property returns the same value that passed into the constructor, or null if the inner exception value was not supplied to the constructor. To simplify the above definition, we can say that, when there is a series of exceptions, then the most current exception obtains the previous exception details in the InnerException property. Suppose, in our application, from Method1, we are calling Method2. In Method2, we are getting one exception let’s say divide by zero exception, and then from Method1 we are getting another exception, let’s say Format exception. Then, in this case, the current exception or the latest exception is Format Exception and in the Format Exception InnerException property, you will get the previous exception details i.e. Divide By Zero Exception. The text document of this video: https://dotnettutorials.net/lesson/inner-exception-csharp/ #csharpinnerexception #innerexceptionexamplecsharp #innerexceptioncsharp #csharp #csharptutorials #dotnettutorials Inner Exception Inner Exception in C# Inner Exception in C# with Examples Inner Exception in CSharp Inner Exception in CSharp with Examples C# Inner Exception C# Inner Exception Examples C# Inner Exception in Examples CSharp Inner Exception CSharp Inner Exception Examples CSharp Inner Exception with Examples Inner Exception C# Inner Exception CSharp What is Inner Exception in C#? What is Inner Exception in CSharp?
Download
0 formatsNo download links available.