namespace CustomExceptionHandling
public class TestCustomException : Exception
public TestCustomException(string message) : base(message)
this.HelpLink = "Visit to qawithexperts.com for more information";
this.Source = "This is source of Error";
public static void Show()
throw new TestCustomException("This is Custom Exception example in C#");
public static void Main(string[] args)
catch (TestCustomException ex)
Console.WriteLine("Error Message:-" + ex.Message);
Console.WriteLine("Hyper Link :-" + ex.HelpLink);
Console.WriteLine("Source :- " + ex.Source);