Exception Handling

How should the State Machine handle exceptions?

Design Principles

  • The exception handling should feel very natural to a .NET Developer. The closest thing in the framework would be the way that Task<T> handles exceptions. See Exception Handling (Task Parallel Library)
  • The developer should have the option of providing an UnhandledExceptionAction via a Callback to the workflow application


Given
  • A state machine that has an unhandled exception
When
  • The unhandled exception is thrown
Then
  • If an OnUnhandledException Func is provided, it is invoked on the workflow thread and the UnhandledExceptionAction value is handled by the Workflow runtime.
  • If the Workflow is faulted, the exception is captured in the WorkflowException property and a StateMachineException is thrown on the calling thread as soon as possible with the WorkflowException set to the inner exception property

Last edited Jun 15, 2011 at 12:12 AM by ronjacobs, version 1

Comments

No comments yet.