ExceptionResult Class

Summary

An action result that returns a @!:StatusCodes.Status500InternalServerError- response and performs content negotiation on an [System.Web.Http.HttpError](System.Web.Http.HttpError.yml) based on an [System.Web.Http.ExceptionResult.Exception](System.Web.Http.ExceptionResult.yml).

Syntax

public class ExceptionResult : ObjectResult, IActionResult

GitHub

View on GitHub

class System.Web.Http.ExceptionResult

Constructors

ExceptionResult(System.Exception, System.Boolean)

Initializes a new instance of the [System.Web.Http.ExceptionResult](System.Web.Http.ExceptionResult.yml) class.

Arguments:
  • exception (System.Exception) – The exception to include in the error.
  • includeErrorDetail (System.Boolean) – <see langword=”true” /> if the error should include exception messages; otherwise, <see langword=”false” />.
public ExceptionResult(Exception exception, bool includeErrorDetail)

Properties

Exception()

Gets the exception to include in the error.

Return type:System.Exception
public Exception Exception { get; }
IncludeErrorDetail()

Gets a value indicating whether the error should include exception messages.

Return type:System.Boolean
public bool IncludeErrorDetail { get; }

Methods

ExecuteResultAsync(Microsoft.AspNet.Mvc.ActionContext)
Arguments:
Return type:

System.Threading.Tasks.Task

public override Task ExecuteResultAsync(ActionContext context)