AggregateException AggregateException AggregateException AggregateException Constructors

Definition

Overloads

AggregateException() AggregateException() AggregateException()

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

AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>)

Initializes a new instance of the AggregateException class with references to the inner exceptions that are the cause of this exception.

AggregateException(Exception[]) AggregateException(Exception[]) AggregateException(Exception[]) AggregateException(Exception[])

Initializes a new instance of the AggregateException class with references to the inner exceptions that are the cause of this exception.

AggregateException(String) AggregateException(String) AggregateException(String) AggregateException(String)

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

AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext)

Initializes a new instance of the AggregateException class with serialized data.

AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>)

Initializes a new instance of the AggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.

AggregateException(String, Exception) AggregateException(String, Exception) AggregateException(String, Exception) AggregateException(String, Exception)

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

AggregateException(String, Exception[]) AggregateException(String, Exception[]) AggregateException(String, Exception[]) AggregateException(String, Exception[])

Initializes a new instance of the AggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.

AggregateException() AggregateException() AggregateException()

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

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

Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "System.AggregateException: One or more errors occurred." This message takes into account the current system culture.

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

Property Value
InnerException null.
Message The localized error message string.
See also

AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>) AggregateException(IEnumerable<Exception>)

Initializes a new instance of the AggregateException class with references to the inner exceptions that are the cause of this exception.

public:
 AggregateException(System::Collections::Generic::IEnumerable<Exception ^> ^ innerExceptions);
public AggregateException (System.Collections.Generic.IEnumerable<Exception> innerExceptions);
new AggregateException : seq<Exception> -> AggregateException
Public Sub New (innerExceptions As IEnumerable(Of Exception))

Parameters

innerExceptions
IEnumerable<Exception>

The exceptions that are the cause of the current exception.

Exceptions

AggregateException(Exception[]) AggregateException(Exception[]) AggregateException(Exception[]) AggregateException(Exception[])

Initializes a new instance of the AggregateException class with references to the inner exceptions that are the cause of this exception.

public:
 AggregateException(... cli::array <Exception ^> ^ innerExceptions);
public AggregateException (params Exception[] innerExceptions);
new AggregateException : Exception[] -> AggregateException
Public Sub New (ParamArray innerExceptions As Exception())

Parameters

innerExceptions
Exception[]

The exceptions that are the cause of the current exception.

Exceptions

AggregateException(String) AggregateException(String) AggregateException(String) AggregateException(String)

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

public:
 AggregateException(System::String ^ message);
public AggregateException (string message);
new AggregateException : string -> AggregateException
Public Sub New (message As String)

Parameters

message
String String String 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 AggregateException.

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

AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext) AggregateException(SerializationInfo, StreamingContext)

Initializes a new instance of the AggregateException class with serialized data.

protected:
 AggregateException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Security.SecurityCritical]
protected AggregateException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new AggregateException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> AggregateException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

The object that holds the serialized object data.

context
StreamingContext StreamingContext StreamingContext StreamingContext

The contextual information about the source or destination.

Exceptions

Remarks

This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see XML and SOAP Serialization.

See also

AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>) AggregateException(String, IEnumerable<Exception>)

Initializes a new instance of the AggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.

public:
 AggregateException(System::String ^ message, System::Collections::Generic::IEnumerable<Exception ^> ^ innerExceptions);
public AggregateException (string message, System.Collections.Generic.IEnumerable<Exception> innerExceptions);
new AggregateException : string * seq<Exception> -> AggregateException
Public Sub New (message As String, innerExceptions As IEnumerable(Of Exception))

Parameters

message
String String String String

The error message that explains the reason for the exception.

innerExceptions
IEnumerable<Exception>

The exceptions that are the cause of the current exception.

Exceptions

AggregateException(String, Exception) AggregateException(String, Exception) AggregateException(String, Exception) AggregateException(String, Exception)

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

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

Parameters

message
String String String 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 Exception Exception 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.

Exceptions

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 AggregateException.

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

AggregateException(String, Exception[]) AggregateException(String, Exception[]) AggregateException(String, Exception[]) AggregateException(String, Exception[])

Initializes a new instance of the AggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.

public:
 AggregateException(System::String ^ message, ... cli::array <Exception ^> ^ innerExceptions);
public AggregateException (string message, params Exception[] innerExceptions);
new AggregateException : string * Exception[] -> AggregateException
Public Sub New (message As String, ParamArray innerExceptions As Exception())

Parameters

message
String String String String

The error message that explains the reason for the exception.

innerExceptions
Exception[]

The exceptions that are the cause of the current exception.

Exceptions

Applies to