Table of Contents

Class UnhandledDomainEventException

Namespace
Excalibur.Domain.Exceptions
Assembly
Excalibur.Domain.dll

Thrown when an aggregate's event-application logic does not recognize a domain event type — a missing switch arm in ApplyEventInternal. Enforces totality: an unrecognized event fails loud rather than being silently ignored while the aggregate version still advances (which would rehydrate a state that never legitimately existed).

public sealed class UnhandledDomainEventException : DomainException, ISerializable
Inheritance
UnhandledDomainEventException
Implements
Inherited Members

Constructors

UnhandledDomainEventException()

Initializes a new instance of the UnhandledDomainEventException class with a default message.

public UnhandledDomainEventException()

UnhandledDomainEventException(string)

Initializes a new instance of the UnhandledDomainEventException class with a specified message.

public UnhandledDomainEventException(string message)

Parameters

message string

A message describing the exception.

UnhandledDomainEventException(string, Exception?)

Initializes a new instance of the UnhandledDomainEventException class with a specified message and inner exception.

public UnhandledDomainEventException(string message, Exception? innerException)

Parameters

message string

A message describing the exception.

innerException Exception

The exception that caused the current exception.

UnhandledDomainEventException(Type, Type)

Initializes a new instance of the UnhandledDomainEventException class.

public UnhandledDomainEventException(Type aggregateType, Type eventType)

Parameters

aggregateType Type

The aggregate type whose apply logic did not handle the event.

eventType Type

The unrecognized domain event type.

Properties

AggregateType

Gets the aggregate type whose apply logic did not handle the event, if known.

public Type? AggregateType { get; }

Property Value

Type

The aggregate type, or null when constructed without one.

EventType

Gets the unrecognized domain event type, if known.

public Type? EventType { get; }

Property Value

Type

The event type, or null when constructed without one.