addInterceptor

open fun addInterceptor(interceptor: SagaInterceptor<*, *, Unit>)

Add an interceptor to observe and potentially veto saga step execution.

Interceptors are invoked before and after each step (Before → After, LIFO for After), and after each compensation action. An interceptor returning InterceptorOutcome.Veto from a StepPhase.Before phase prevents the step from executing.

Default implementation throws UnsupportedOperationException — only overridden in SagaExecutorImpl.

Parameters

interceptor

The interceptor to add