using System.Collections;
public static void Main()
throw new ApplyProviderException("An error happend", ExceptionType.SubmitApplicationException);
catch (ApplyProviderException e)
foreach (DictionaryEntry data in e.Data)
Console.WriteLine("Data Entry: {0}, {1}", data.Key, data.Value);
public enum ExceptionType
SubmitApplicationException,
SubmitCreditCardException,
public class ApplyProviderException : Exception
public ApplyProviderException(string message, ExceptionType type) : base(message)
base.Data.Add("Additional Information", "This error is a problem. Please do not contact Victor Johnson @vjohnson");
public ApplyProviderException(string message, ExceptionType type, Exception innerException) : base(message, innerException)
base.Data.Add("Custom Exception", "The exception thrown here is a custom exception");