SagaException silently ignored by NHibernateSagaRepository
See original GitHub issueI have following problem: when my saga throws NotAcceptedStateMachineException then problematic event is not moved to error queue.
Exception is throwed here.
Then it is consumed by DefaultUnhandledEventCallback, which converts it to UnhandledEventException.
Then it is catched in SendToInstance method, which converts it to SagaException, which exception is silently ignored here.
Here’s whole stack trace:
at Automatonymous.AutomatonymousStateMachine
1.DefaultUnhandledEventCallback(UnhandledEventContext1 context) at Automatonymous.AutomatonymousStateMachine1.UnhandledEvent(EventContext1 context, State state) at Automatonymous.States.StateMachineState1.<Automatonymous-State<TInstance>-Raise>d__271.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Automatonymous.AutomatonymousStateMachine1.<Automatonymous-StateMachine<TInstance>-RaiseEvent>d__211.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Automatonymous.Pipeline.StateMachineSagaMessageFilter2.<Send>d__5.MoveNext() --- End of inner exception stack trace --- at Automatonymous.Pipeline.StateMachineSagaMessageFilter2.<Send>d__5.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MassTransit.NHibernateIntegration.Saga.NHibernateSagaRepository1.<SendToInstance>d__101.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MassTransit.NHibernateIntegration.Saga.NHibernateSagaRepository1.<SendQuery>d__81.MoveNext()
Is it intended behavior or rethrow is missing here?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)

Top Related StackOverflow Question
Hi. Same problem occurs here. Exception is silently ignored.
@phatboyg: Should I create new issue or you can reopen this?
No I meant you changed both in that commit