Class HttpException
Describes an exception that occurred during the processing of HTTP requests.
Inheritance
Implements
Inherited Members
Namespace: Terrasoft.Web.Http.Abstractions
Assembly: Terrasoft.Web.Http.Abstractions.dll
Syntax
public class HttpException : ExternalException, ISerializable, _Exception
Constructors
HttpException()
Initializes a new instance of the HttpException class.
Declaration
public HttpException()
HttpException(Int32, String)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(int httpCode, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | httpCode | The HTTP code. |
System.String | message | The error message that explains the reason for the exception. |
HttpException(Int32, String, Exception)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(int httpCode, string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | httpCode | The HTTP code. |
System.String | message | The message. |
System.Exception | innerException | The inner exception. |
HttpException(Int32, String, Int32)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(int httpCode, string message, int hr)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | httpCode | The HTTP code. |
System.String | message | The error message that explains the reason for the exception. |
System.Int32 | hr | The System.Exception.HResult value. |
HttpException(HttpStatusCode, String)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(HttpStatusCode httpCode, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | httpCode | The HTTP code. |
System.String | message | The error message that explains the reason for the exception. |
HttpException(HttpStatusCode, String, Exception)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(HttpStatusCode httpCode, string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpStatusCode | httpCode | The HTTP code. |
System.String | message | The error message that explains the reason for the exception. |
System.Exception | innerException | The inner exception. |
HttpException(SerializationInfo, StreamingContext)
Initializes a new instance of the HttpException class.
Declaration
protected HttpException(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The object that holds the serialized object data. |
System.Runtime.Serialization.StreamingContext | context | The contextual information about the source or destination. |
HttpException(String)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The error message that specifies the reason for the exception. |
HttpException(String, Exception)
Initializes a new instance of the HttpException class.
Declaration
public HttpException(string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The error message that explains the reason for the exception. |
System.Exception | innerException | The exception that is the cause of the current exception. |
Methods
GetHttpCode()
Gets the HTTP response status code to return to the client.
Declaration
public int GetHttpCode()
Returns
Type | Description |
---|---|
System.Int32 |
GetHttpStatusCode()
Gets the HTTP response status code to return to the client.
Declaration
public HttpStatusCode GetHttpStatusCode()
Returns
Type | Description |
---|---|
System.Net.HttpStatusCode |
GetObjectData(SerializationInfo, StreamingContext)
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |