title: How to bind a target within MSBuild to a general error
body: <p>We are using TFS build and we have a couple of custom steps within the configuration (e.g. running NUnit tests in <code>AfterCompile</code> target, deployment steps in <code>AfterDropBuild</code> target etc.). Now I wanted to add the functionality of sending emails on broken builds. I have configured a mail task from MS Community tasks and put it to the <code>BeforeOnBuildBreak</code> target. This works perfectly if there is a compilation error, we are even getting the notification emails. </p>
  
  <p>However, when there is an error in some custom task (e.g. there is a failed test in this NUnit test run), the BeforeOnBuildBreak target is not even executed. Is there some other (more general) target or any other way to execute custom logic in case of any build failure ?</p>