Try our conversational search powered by Generative AI!

Interface IPropertyException

All friendly exceptions from PropertyData should support this interface

Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public interface IPropertyException

Methods

ChangeDisplayName(String)

Change the name of originating error source after an exception occurred, for example another name for a property.

Declaration
void ChangeDisplayName(string displayName)
Parameters
Type Name Description
System.String displayName

The new name to be used

Remarks

Properties will by default throw their own data type as originator because validation is often done in static methods on postbacks.

Examples
  Change name of source after catching an exception
            PropertyString prop = new PropertyString();
prop.IsRequired = true;
try
{
    prop.Clear();
}
catch (RequiredPropertyValueException e)
{
    e.ChangeDisplayName("Footer");
    throw e;
}

Extension Methods