Skip to main content

WebException Class

Namespace: System.Net · Assembly: GHIElectronics.TinyCLR.Networking.Http

Defines the exception that is thrown by System.Net.WebRequest instances when an error occurs.

public class WebException : InvalidOperationException

Constructors

WebException()

public WebException()

The default constructor.

WebException(string message)

public WebException(string message) : base(message)

Constructs a WebException based on the specified message string.

ParameterTypeDescription
messagestringThe message string for the exception.

WebException(string message, Exception innerException)

public WebException(string message, Exception innerException) : base(message, innerException)

Constructs a WebException based on the specified message string and inner exception.

ParameterTypeDescription
messagestringThe message string for the exception.
innerExceptionExceptionThe exception that caused this exception.

WebException(string message, WebExceptionStatus status)

public WebException(string message, WebExceptionStatus status) : base(message)

Constructs a WebException based on the specified message string and WebExceptionStatus .

ParameterTypeDescription
messagestringThe message string for the exception.
statusWebExceptionStatusThe network status of the exception.

WebException(string message, Exception inner, WebExceptionStatus status, WebResponse response)

public WebException(string message, Exception inner, WebExceptionStatus status, WebResponse response) : base(message, inner)

Constructs a WebException based on the specified message string, inner exception, System.Net.WebExceptionStatus, and System.Net.WebResponse.

ParameterTypeDescription
messagestringMessage string for exception.
innerExceptionThe exception that caused this exception.
statusWebExceptionStatusThe network status of the exception.
responseWebResponseThe WebResponse we have.

Properties

Status

public WebExceptionStatus Status { get; }

Gets the WebExceptionStatus code.

Response

public WebResponse Response { get; }

Gets the response that the remote host returned.