System.SystemException Class

public class SystemException : Exception

Base Types

Object
  Exception
    SystemException

Assembly

mscorlib

Library

BCL

Summary

SystemException is the base class for all exceptions defined by the system.

Description

This class is provided as a means to differentiate between exceptions defined by the system versus exceptions defined by applications. [Note: For more information on exceptions defined by applications, see ApplicationException.]

[Note: SystemException does not provide information as to the cause of the Exception. In most scenarios, instances of this class should not be thrown. In cases where this class is instantiated, a human-readable message describing the error should be passed to the constructor.]

See Also

System Namespace

Members

SystemException Constructors

SystemException() Constructor
SystemException(System.String) Constructor
SystemException(System.String, System.Exception) Constructor


SystemException() Constructor

public SystemException();

Summary

Constructs and initializes a new instance of the SystemException class.

Description

This constructor initializes the System.SystemException.Message property of the new instance to a system-supplied message that describes the error, such as "A system error has occurred." This message takes into account the current system culture.

The System.SystemException.InnerException property is initialized to null .

See Also

System.SystemException Class, System Namespace

SystemException(System.String) Constructor

public SystemException(string message);

Summary

Constructs and initializes a new instance of the SystemException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Description

This constructor initializes the System.SystemException.Message property of the new instance using message. If message is null , the System.SystemException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments. The System.SystemException.InnerException property is initialized to null .

See Also

System.SystemException Class, System Namespace

SystemException(System.String, System.Exception) Constructor

public SystemException(string message, Exception innerException);

Summary

Constructs and initializes a new instance of the SystemException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
innerException
An instance of Exception that is the cause of the current Exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException .

Description

This constructor initializes the System.SystemException.Message property of the new instance using message, and the System.SystemException.InnerException property using innerException. If message is null , the System.SystemException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

[Note: For information on inner exceptions, see System.Exception.InnerException .]

See Also

System.SystemException Class, System Namespace