Class ComponentValidationException
- Namespace
- KeenEyes
- Assembly
- KeenEyes.Core.dll
Exception thrown when component validation fails during entity creation or modification.
public class ComponentValidationException : InvalidOperationException, ISerializable
- Inheritance
-
ComponentValidationException
- Implements
- Inherited Members
Remarks
This exception is thrown when:
- A component marked with KeenEyes.RequiresComponentAttribute is added to an entity that is missing the required component.
- A component marked with KeenEyes.ConflictsWithAttribute is added to an entity that already has the conflicting component.
-
A custom validator registered via KeenEyes.ComponentValidationManager.RegisterValidator<T>(KeenEyes.ComponentValidator<T>)
returns
false.
Constructors
ComponentValidationException(string, Type)
Initializes a new instance of the ComponentValidationException class.
public ComponentValidationException(string message, Type componentType)
Parameters
messagestringThe error message that explains the reason for the exception.
componentTypeTypeThe type of component that failed validation.
ComponentValidationException(string, Type, Entity)
Initializes a new instance of the ComponentValidationException class.
public ComponentValidationException(string message, Type componentType, Entity entity)
Parameters
messagestringThe error message that explains the reason for the exception.
componentTypeTypeThe type of component that failed validation.
entityEntityThe entity on which validation failed.
ComponentValidationException(string, Type, Exception)
Initializes a new instance of the ComponentValidationException class.
public ComponentValidationException(string message, Type componentType, Exception innerException)
Parameters
messagestringThe error message that explains the reason for the exception.
componentTypeTypeThe type of component that failed validation.
innerExceptionExceptionThe exception that is the cause of the current exception.
Properties
ComponentType
Gets the type of component that failed validation.
public Type ComponentType { get; }
Property Value
Entity
Gets the entity on which validation failed, if applicable.
public Entity? Entity { get; }
Property Value
- Entity?