title: ExceptionFilter difference between OnExceptionAsync vs.OnException
body: <p>That's it.</p>
  
  <p>When writing <strong>custome exception filter</strong> in MVC or WebApi, what is the difference between <strong>OnExceptionAsync</strong> and <strong>OnException</strong> methods?
  Is it so that OnExceptionAsync is called only when using asynchronous controllers?
  Or both are called?</p>
  
  <p>When to use which?</p>
  
  <p>How to use OnExceptionAsync which returns task result?</p>
  
  <p>Some base code to ilustrate:</p>
  
  <pre><code>public class ApiExceptionFilterAttribute : ExceptionFilterAttribute
  {
      public override void OnException(HttpActionExecutedContext actionExecutedContext)
      {
          //TODO exception handling
      }
  
      public override Task OnExceptionAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
      {
          //TODO exception handling
      }
  }
  </code></pre>