HttpError 构造函数

定义

重载

HttpError()

初始化 HttpError 类的新实例。

HttpError(String)

初始化包含错误消息 messageHttpError 类的新实例。

HttpError(ModelStateDictionary, Boolean)

初始化 类modelState的新实例HttpError

HttpError(Exception, Boolean)

初始化 类exception的新实例HttpError

HttpError()

Source:
HttpError.cs
Source:
HttpError.cs

初始化 HttpError 类的新实例。

public HttpError ();
Public Sub New ()

适用于

HttpError(String)

Source:
HttpError.cs
Source:
HttpError.cs

初始化包含错误消息 messageHttpError 类的新实例。

public HttpError (string message);
new System.Web.Http.HttpError : string -> System.Web.Http.HttpError
Public Sub New (message As String)

参数

message
String

要与此实例关联的错误消息。

适用于

HttpError(ModelStateDictionary, Boolean)

Source:
HttpError.cs
Source:
HttpError.cs

初始化 类modelState的新实例HttpError

public HttpError (Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState, bool includeErrorDetail);
new System.Web.Http.HttpError : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary * bool -> System.Web.Http.HttpError
Public Sub New (modelState As ModelStateDictionary, includeErrorDetail As Boolean)

参数

modelState
ModelStateDictionary

要用于错误信息的无效模型状态。

includeErrorDetail
Boolean

true 在错误中包含异常消息; false 否则。

适用于

HttpError(Exception, Boolean)

Source:
HttpError.cs
Source:
HttpError.cs

初始化 类exception的新实例HttpError

public HttpError (Exception exception, bool includeErrorDetail);
new System.Web.Http.HttpError : Exception * bool -> System.Web.Http.HttpError
Public Sub New (exception As Exception, includeErrorDetail As Boolean)

参数

exception
Exception

要用于错误信息的异常。

includeErrorDetail
Boolean

true 以在错误中包含异常信息;false 否则。

适用于