Class RxAggregateException
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents one or more errors that occur during application execution.
public class RxAggregateException : RanorexException, ISerializable, _Exception
- Inheritance
-
RxAggregateException
- Implements
- Inherited Members
Remarks
RxAggregateException is used to consolidate multiple failures into a single, throwable exception object.
Constructors
RxAggregateException()
Initializes a new instance of the RxAggregateException class.
public RxAggregateException()
RxAggregateException(IEnumerable<Exception>)
Initializes a new instance of the RxAggregateException class with references to the inner exceptions that are the cause of this exception.
public RxAggregateException(IEnumerable<Exception> innerExceptions)
Parameters
innerExceptionsIEnumerable<Exception>The exceptions that are the cause of the current exception.
Exceptions
- ArgumentNullException
The
innerExceptionsargument is null.- ArgumentException
An element of
innerExceptionsis null.
RxAggregateException(params Exception[])
Initializes a new instance of the RxAggregateException class with references to the inner exceptions that are the cause of this exception.
public RxAggregateException(params Exception[] innerExceptions)
Parameters
innerExceptionsException[]The exceptions that are the cause of the current exception.
Exceptions
- ArgumentNullException
The
innerExceptionsargument is null.- ArgumentException
An element of
innerExceptionsis null.
RxAggregateException(SerializationInfo, StreamingContext)
Initializes a new instance of the RxAggregateException class with serialized data.
[SecurityCritical]
protected RxAggregateException(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
contextStreamingContextThe StreamingContext that contains contextual information about the source or destination.
Exceptions
- ArgumentNullException
The
infoargument is null.- SerializationException
The exception could not be deserialized correctly.
RxAggregateException(string)
Initializes a new instance of the RxAggregateException class with a specified error message.
public RxAggregateException(string message)
Parameters
messagestringThe error message that explains the reason for the exception.
RxAggregateException(string, IEnumerable<Exception>)
Initializes a new instance of the RxAggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.
public RxAggregateException(string message, IEnumerable<Exception> innerExceptions)
Parameters
messagestringThe error message that explains the reason for the exception.
innerExceptionsIEnumerable<Exception>The exceptions that are the cause of the current exception.
Exceptions
- ArgumentNullException
The
innerExceptionsargument is null.- ArgumentException
An element of
innerExceptionsis null.
RxAggregateException(string, Exception)
Initializes a new instance of the RxAggregateException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public RxAggregateException(string message, Exception innerException)
Parameters
messagestringThe error message that explains the reason for the exception.
innerExceptionExceptionThe exception that is the cause of the current exception.
Exceptions
- ArgumentNullException
The
innerExceptionargument is null.
RxAggregateException(string, params Exception[])
Initializes a new instance of the RxAggregateException class with a specified error message and references to the inner exceptions that are the cause of this exception.
public RxAggregateException(string message, params Exception[] innerExceptions)
Parameters
messagestringThe error message that explains the reason for the exception.
innerExceptionsException[]The exceptions that are the cause of the current exception.
Exceptions
- ArgumentNullException
The
innerExceptionsargument is null.- ArgumentException
An element of
innerExceptionsis null.
Properties
InnerExceptions
Gets a read-only collection of the Exception instances that caused the current exception.
public IList<Exception> InnerExceptions { get; }
Property Value
Methods
Flatten()
Flattens an RxAggregateException instances into a single, new instance.
public RxAggregateException Flatten()
Returns
- RxAggregateException
A new, flattened RxAggregateException.
Remarks
If any inner exceptions are themselves instances of RxAggregateException, this method will recursively flatten all of them. The inner exceptions returned in the new RxAggregateException will be the union of all of the inner exceptions from exception tree rooted at the provided RxAggregateException instance.
GetBaseException()
Returns the RxAggregateException that is the root cause of this exception.
public override Exception GetBaseException()
Returns
- Exception
The root cause exception.
GetObjectData(SerializationInfo, StreamingContext)
Sets the SerializationInfo with information about the exception.
[SecurityCritical]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
contextStreamingContextThe StreamingContext that contains contextual information about the source or destination.
Exceptions
- ArgumentNullException
The
infoargument is null.
Handle(Func<Exception, bool>)
Invokes a handler on each Exception contained by this RxAggregateException.
public void Handle(Func<Exception, bool> predicate)
Parameters
predicateFunc<Exception, bool>The predicate to execute for each exception. The predicate accepts as an argument the Exception to be processed and returns a Boolean to indicate whether the exception was handled.
Remarks
Each invocation of the predicate returns true or false to indicate whether the
Exception was handled. After all invocations, if any exceptions went
unhandled, all unhandled exceptions will be put into a new RxAggregateException
which will be thrown. Otherwise, the Handle(Func<Exception, bool>) method simply returns. If any
invocations of the predicate throws an exception, it will halt the processing
of any more exceptions and immediately propagate the thrown exception as-is.
Exceptions
- RxAggregateException
An exception contained by this RxAggregateException was not handled.
- ArgumentNullException
The
predicateargument is null.
ToString()
Creates and returns a string representation of the current RxAggregateException.
public override string ToString()
Returns
- string
A string representation of the current exception.