Class WebApiException
Defines an abstract base class for the Web API exceptions.
Inheritance
Implements
Inherited Members
Namespace: Juhta.Net.WebApi.Exceptions
Assembly: Juhta.Net.WebApi.Exceptions.dll
Syntax
public abstract class WebApiException : Exception, ISerializable
Constructors
| Improve this Doc View SourceWebApiException(WebApiErrorResponse, String)
Initializes a new instance.
Declaration
protected WebApiException(WebApiErrorResponse webApiErrorResponse, string message)
Parameters
Type | Name | Description |
---|---|---|
WebApiErrorResponse | webApiErrorResponse | Specifies a Web API error response. |
System.String | message | Specifies an error message. |
WebApiException(HttpStatusCode, String, Exception)
Initializes a new instance.
Declaration
protected WebApiException(HttpStatusCode statusCode, string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | statusCode | Specifies an HTTP status code. |
System.String | message | Specifies an error message. |
System.Exception | innerException | Specifies an inner exception. |
Properties
| Improve this Doc View SourceServiceStack
Gets the service stack related to this WebApiException instance.
Declaration
public string[] ServiceStack { get; }
Property Value
Type | Description |
---|---|
System.String[] |
StatusCode
Gets the HTTP status code related to this WebApiException instance.
Declaration
public HttpStatusCode StatusCode { get; }
Property Value
Type | Description |
---|---|
System.Net.HttpStatusCode |
Methods
| Improve this Doc View SourceSetServiceName(String)
Sets the name of the service that the process represents.
Declaration
public static void SetServiceName(string serviceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceName | Specifies a service name. |
Remarks
The service name appears in the values of the ServiceStack property of the instances of this class. The default value for the service name is the file name (without extension) of the entry assembly.
ToString()
Converts this WebApiException instance to a string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Returns this WebApiExceptioninstance as a string. |