HttpParseException Constructors

Definition

Initializes a new instance of the HttpParseException class.

Overloads

HttpParseException()

Initializes a new instance of the HttpParseException class.

HttpParseException(String)

Initializes a new instance of the HttpParseException class with a specified error message.

HttpParseException(String, Exception)

Initializes a new instance of the HttpParseException class with a specified error message and a reference to the inner.

HttpParseException(String, Exception, String, String, Int32)

Initializes a new instance of the HttpParseException class with specific information about the source code being compiled and the line number on which the exception occurred.

HttpParseException()

Initializes a new instance of the HttpParseException class.

C#
public HttpParseException();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

HttpParseException(String)

Initializes a new instance of the HttpParseException class with a specified error message.

C#
public HttpParseException(string message);

Parameters

message
String

The exception message to specify when the error occurs.

Examples

The following example demonstrates the use of the HttpException constructor. For a complete, working code example, see the HttpParseException overview topic.

C#
throw new HttpParseException("This custom HtmlSelect control" +                                                  "requires child elements of the form \"MyCustomOption\"");

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

HttpParseException(String, Exception)

Initializes a new instance of the HttpParseException class with a specified error message and a reference to the inner.

C#
public HttpParseException(string message, Exception innerException);

Parameters

message
String

The exception message to specify when the error occurs.

innerException
Exception

The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

HttpParseException(String, Exception, String, String, Int32)

Initializes a new instance of the HttpParseException class with specific information about the source code being compiled and the line number on which the exception occurred.

C#
public HttpParseException(string message, Exception innerException, string virtualPath, string sourceCode, int line);

Parameters

message
String

The exception message to specify when the error occurs.

innerException
Exception

The exception that is the cause of the current exception. If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

virtualPath
String

The virtual path for the exception.

sourceCode
String

The source code being compiled when the exception occurs.

line
Int32

The line number on which the exception occurred.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1