SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a running Site workflow. If the workflow fails for whatever reason, I want to log it in a special way so that I don't have to struggle with the ULS log to figure out what went wrong.

How can I add a general (catch all) fault handler to a Site state machine workflow (all examples I find are for sequential workflows)?

Is it even possible?

share|improve this question

Try to use SPWorkflowEventReceiver. If I'm not wrong the WorkflowPostponed is invoked when the exception is thrown. In this method you have access to the SPWorkflowEventProperties. There are ErrorException and ErrorMessage properties that can be used by you.

share|improve this answer
Thanks for the answer, but somehow I have the feeling that this is sort of a workaround, or is it not? – JohnDoDo Apr 26 '12 at 12:25
It is not a workaround. There is a question about this in the Microsoft SharePoint 2010 Application Development exam. – Alexander Apr 26 '12 at 13:09
And that's the only way? You can't add fault handlers to a state machine workflow? – JohnDoDo Apr 26 '12 at 14:17
As I know each state of the workflow has own fault handler. You can try to create activity that is handle the exception and add it to this fault handler. To see it you can click Fault Handler context menu item. – Alexander Apr 26 '12 at 14:35
Sorry.. each event driven activity has "view fault handlers" option, not a state. – Alexander Apr 26 '12 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.