Skip to content

Instantly share code, notes, and snippets.

@odeheurles
Created June 25, 2014 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odeheurles/a0f838e4b83e53f88379 to your computer and use it in GitHub Desktop.
Save odeheurles/a0f838e4b83e53f88379 to your computer and use it in GitHub Desktop.
Error handling
_stateMachine.OnUnhandledTrigger(OnUnhandledTrigger);
private void OnUnhandledTrigger(RfqState state, RfqEvent trigger)
{
var message = string.Format("State machine received an invalid trigger '{0}' in state '{1}'", trigger, state);
Console.WriteLine(message);
_rfqUpdateSubject.OnError(new ApplicationException(message));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment