ServerException 构造函数
定义
初始化 ServerException 类的新实例。Initializes a new instance of the ServerException class.
重载
| ServerException() |
使用默认属性初始化 ServerException 类的新实例。Initializes a new instance of the ServerException class with default properties. |
| ServerException(String) |
用指定的消息初始化 ServerException 类的新实例。Initializes a new instance of the ServerException class with a specified message. |
| ServerException(String, Exception) |
使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 ServerException 类的新实例。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()
使用默认属性初始化 ServerException 类的新实例。Initializes a new instance of the ServerException class with default properties.
public:
ServerException();
public ServerException ();
Public Sub New ()
注解
ServerException 继承自 SystemException 类。ServerException inherits from the SystemException class. 下表显示了类的实例的初始属性值 ServerException :The following table shows initial property values for an instance of the ServerException class:
| 属性Property | ValueValue |
|---|---|
| InnerException | null |
| Message | 空字符串 ( "" ) The empty string ("") |
另请参阅
适用于
ServerException(String)
用指定的消息初始化 ServerException 类的新实例。Initializes a new instance of the ServerException class with a specified message.
public:
ServerException(System::String ^ message);
public ServerException (string message);
new System.Runtime.Remoting.ServerException : string -> System.Runtime.Remoting.ServerException
Public Sub New (message As String)
参数
- message
- String
描述该异常的消息The message that describes the exception
注解
ServerException 继承自 SystemException 类。ServerException inherits from the SystemException class. 下表显示了类的实例的初始属性值 ServerException :The following table shows initial property values for an instance of the ServerException class:
| 属性类型Property Type | 条件Condition |
|---|---|
| InnerException | null |
| Message | message字符串The message string |
另请参阅
适用于
ServerException(String, Exception)
使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 ServerException 类的新实例。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.
public:
ServerException(System::String ^ message, Exception ^ InnerException);
public ServerException (string message, Exception InnerException);
new System.Runtime.Remoting.ServerException : string * Exception -> System.Runtime.Remoting.ServerException
Public Sub New (message As String, InnerException As Exception)
参数
- message
- String
解释异常原因的错误消息。The error message that explains the reason for the exception.
- InnerException
- Exception
导致当前异常的异常。The exception that is the cause of the current exception. 如果 InnerException 参数不为 null,则当前异常将在处理内部异常的 catch 块中引发。If the InnerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.
注解
因前一个异常而直接引发的异常应在 InnerException 属性中包含对前一个异常的引用。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. InnerException 属性将返回传递给构造函数的同一值;如果 InnerException 属性不向构造函数提供内部异常值,则返回 null。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.
下表显示了类的实例的初始属性值 ServerException :The following table shows initial property values for an instance of the ServerException class:
| 属性Property | ValueValue |
|---|---|
| InnerException | 内部异常引用The inner exception reference |
| Message | 错误消息字符串The error message string |