Skip to content

CHR0054: Reactor method has an unsupported return type

A reactor method whose first parameter is an [EventType] but whose synchronous return type is neither a built-in supported shape nor claimed by a registered side-effect handler is skipped during handler discovery. CHR0054 reports return types the analyzer cannot recognize, rather than treating them as unresolvable parameters.

Warning

  • void or Task.
  • A registered event type, EventForEventSourceId, or EventsWithConcurrencyScopes.
  • A custom type marked [ReactorSideEffect] from Cratis.Chronicle.Reactors.SideEffects, including types deriving from a marked base class or implementing a marked interface.
  • A one-dimensional array or IEnumerable<T> implementation where T is a registered event type, EventForEventSourceId, object (for mixed events and targeted events), or a marked side-effect type.
  • Task<T> for any side effect that a registered reactor side-effect handler can process, including the shapes above.

Synchronous custom side effects require a registered IReactorSideEffectHandler whose CanHandleReturnType(Type) claims the declared return type and which processes the returned value. Mark the custom type [ReactorSideEffect] so the analyzer accepts it; the marker only informs the analyzer and registers nothing. For a collection return, the handler must claim and process the collection type, not only its elements. See Custom return type handlers.

  • CHR0004: Reactor method has a parameter that cannot be resolved.
  • CHR0005: Reactor event parameter must have [EventType] attribute.