Table of Contents

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

message string

The error message that explains the reason for the exception.

componentType Type

The 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

message string

The error message that explains the reason for the exception.

componentType Type

The type of component that failed validation.

entity Entity

The 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

message string

The error message that explains the reason for the exception.

componentType Type

The type of component that failed validation.

innerException Exception

The 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

Type

Entity

Gets the entity on which validation failed, if applicable.

public Entity? Entity { get; }

Property Value

Entity?