Exception source and email address : Exception « Development « Visual C++ .NET






Exception source and email address

 
#include "stdafx.h"
using namespace System;

int main()
{

   try
   {
       bool error = true;
       // other code

       if (error)
       {
           throw gcnew Exception("XYZ");
       }
   }
   catch( Exception^ exception)
   {
       Console::WriteLine("Exception Source property {0}", exception->Source);
       Console::WriteLine("Exception StackTrace property {0}",
          exception->StackTrace);
   }
}

   
  








Related examples in the same category

1.Extends Exception class to create custom exception