1 namespace System.Web.Mvc {
3 using System.Diagnostics.CodeAnalysis;
5 public class ExceptionContext : ControllerContext {
7 private ActionResult _result;
9 // parameterless constructor used for mocking
10 public ExceptionContext() {
13 [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")]
14 public ExceptionContext(ControllerContext controllerContext, Exception exception)
15 : base(controllerContext) {
16 if (exception == null) {
17 throw new ArgumentNullException("exception");
20 Exception = exception;
23 public virtual Exception Exception {
28 public bool ExceptionHandled {
33 public ActionResult Result {
35 return _result ?? EmptyResult.Instance;