class Program
 { 
    static void Main(string[] args) 
    { 
         try 
         { 
             int value = int.Parse(" test exception"); 
          } 
         catch (Exception e)
         { 
                throw e; //  According to CLR, is the beginning of the exception located here?
               }
          } 
    }
 
Explanation
In case of "throw e" statement usage (with exception object being explicitly indicated) it is considered that that an exception will be handled. Therefore, new object is created and all information about the exception occurrence reason (StackTrace) is lost.
In case of re-generation of an exception using "throw" statement the starting point in the stack is not reset, so the CLR considers that an exception occurred earlier in a stack.
C#
C# Quiz
Start Quiz

or Read more about C# Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback