Edit

Share via


ServerException Constructors

Definition

Initializes a new instance of the ServerException class.

Overloads

ServerException()

Initializes a new instance of the ServerException class with default properties.

ServerException(String)

Initializes a new instance of the ServerException class with a specified message.

ServerException(String, Exception)

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

ServerException()

Initializes a new instance of the ServerException class with default properties.

C#
public ServerException();

Remarks

ServerException inherits from the SystemException class. The following table shows initial property values for an instance of the ServerException class:

Property Value
InnerException null
Message The empty string ("")

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 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

ServerException(String)

Initializes a new instance of the ServerException class with a specified message.

C#
public ServerException(string message);

Parameters

message
String

The message that describes the exception.

Remarks

ServerException inherits from the SystemException class. The following table shows initial property values for an instance of the ServerException class:

Property Type Condition
InnerException null
Message The message string

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 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

ServerException(String, Exception)

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

C#
public ServerException(string message, Exception InnerException);

Parameters

message
String

The error message that explains the reason for the exception.

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.

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 initial property values for an instance of the ServerException class:

Property Value
InnerException The inner exception reference
Message The error message string

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 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