Επεξεργασία

Κοινή χρήση μέσω


DataServiceException Constructors

Definition

Initializes a new instance of the DataServiceException class.

Overloads

DataServiceException()

Initializes a new instance of the DataServiceException class with a system-supplied message that describes the error.

DataServiceException(String)

Initializes a new instance of the DataServiceException class with a specified message that describes the error.

DataServiceException(Int32, String)

Initializes a new instance of the DataServiceException class.

DataServiceException(String, Exception)

Initializes a new instance of the DataServiceException class with a specified error message and a reference to the inner exception that is the cause of this exception.

DataServiceException(Int32, String, String, String, Exception)

Initializes a new instance of the DataServiceException class.

DataServiceException()

Initializes a new instance of the DataServiceException class with a system-supplied message that describes the error.

public:
 DataServiceException();
public DataServiceException ();
Public Sub New ()

Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error. This message takes into account the current system culture.

See also

Applies to

DataServiceException(String)

Initializes a new instance of the DataServiceException class with a specified message that describes the error.

public:
 DataServiceException(System::String ^ message);
public DataServiceException (string message);
new System.Data.Services.DataServiceException : string -> System.Data.Services.DataServiceException
Public Sub New (message As String)

Parameters

message
String

The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Remarks

The following table shows the initial property values for an instance of DataServiceException.

Property Value
InnerException null.
Message The error message string specified in message.

See also

Applies to

DataServiceException(Int32, String)

Initializes a new instance of the DataServiceException class.

public:
 DataServiceException(int statusCode, System::String ^ message);
public DataServiceException (int statusCode, string message);
new System.Data.Services.DataServiceException : int * string -> System.Data.Services.DataServiceException
Public Sub New (statusCode As Integer, message As String)

Parameters

statusCode
Int32

The HTTP status code returned by the exception.

message
String

The error message for the exception.

Applies to

DataServiceException(String, Exception)

Initializes a new instance of the DataServiceException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 DataServiceException(System::String ^ message, Exception ^ innerException);
public DataServiceException (string message, Exception innerException);
new System.Data.Services.DataServiceException : string * Exception -> System.Data.Services.DataServiceException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

innerException
Exception

The exception that is the cause of the current exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of DataServiceException.

Property Value
InnerException null.
Message The error message string specified in message.

See also

Applies to

DataServiceException(Int32, String, String, String, Exception)

Initializes a new instance of the DataServiceException class.

public:
 DataServiceException(int statusCode, System::String ^ errorCode, System::String ^ message, System::String ^ messageXmlLang, Exception ^ innerException);
public DataServiceException (int statusCode, string errorCode, string message, string messageXmlLang, Exception innerException);
new System.Data.Services.DataServiceException : int * string * string * string * Exception -> System.Data.Services.DataServiceException
Public Sub New (statusCode As Integer, errorCode As String, message As String, messageXmlLang As String, innerException As Exception)

Parameters

statusCode
Int32

The HTTP status code of the exception.

errorCode
String

The string value that contains the error code.

message
String

The string value that contains the error message.

messageXmlLang
String

The string value that indicates the language of the error message.

innerException
Exception

The exception that is the cause of the current exception.

Applies to