Constructor Reference

The HttpException provides several overloaded constructors for communicating custom HTTP error information:

Dim MyHttpEx As New HttpException( )

Creates an empty instance of HttpException.

Throw New HttpException(string)

Throws an HttpException whose Message property is set to the value of the string passed into the constructor.

Throw New HttpException(integer, string)

Throws an HttpException whose GetHttpCode method will return the integer value passed into the constructor, and whose Message property is set to the value of the string passed into the constructor.

Throw New HttpException(string, Exception)

Throws an HttpException whose Message property is set to the value of the string passed into the constructor, and whose InnerException property is set to the Exception object passed into the constructor.

Throw New HttpException(string, integer)

Throws an HttpException whose Message property is set to the value of the string passed into the constructor, and whose ErrorCode property is set to the value of the integer passed into the constructor.

Throw New HttpException(integer, string, Exception)

Throws an HttpException whose GetHttpCode method returns the integer value passed into the constructor, whose Message property is set to the value of the string passed into the constructor, and whose InnerException property is set to the Exception object passed into the constructor.

Throw New HttpException(integer, string, integer)

Throws an HttpException whose ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.