using System; namespace UnityMeshSimplifier { /// /// An exception thrown when validating simplification options. /// public sealed class ValidateSimplificationOptionsException : Exception { private readonly string propertyName; /// /// Creates a new simplification options validation exception. /// /// The property name. /// The exception message. public ValidateSimplificationOptionsException(string propertyName, string message) : base(message) { this.propertyName = propertyName; } /// /// Creates a new simplification options validation exception. /// /// The property name. /// The exception message. /// The exception that caused the validation error. public ValidateSimplificationOptionsException(string propertyName, string message, Exception innerException) : base(message, innerException) { this.propertyName = propertyName; } /// /// Gets the property name that caused the validation error. /// public string PropertyName { get { return propertyName; } } /// /// Gets the message of the exception. /// public override string Message { get { return base.Message + Environment.NewLine + "Property name: " + propertyName; } } } }