Class ExceptionAggregator
Catches exceptions of operations and aggregates them in a list.
Inherited Members
Namespace: Microsoft.XboxStudios.ClientManager
Assembly: ClientManager.dll
Syntax
public static class ExceptionAggregator
Methods
View SourceExecuteAndCatchException(Action, ICollection<Exception>?)
Executes an action, catches any excpetion and adds it to the provided lists of exceptions.
Declaration
public static ICollection<Exception>? ExecuteAndCatchException(Action action, ICollection<Exception>? exceptions)
Parameters
Type | Name | Description |
---|---|---|
Action | action | The action to execute. |
ICollection<Exception> | exceptions | The list of exceptions. |
Returns
Type | Description |
---|---|
ICollection<Exception> | The list of exceptions. The provided list is returned if no exception is thrown. |
ExecuteAndCatchExceptionAsync(Func<Task>, ICollection<Exception>?)
Executes an asynchronous operations, catches an exception and adds it to the provided list of exceptions.
Declaration
public static Task<ICollection<Exception>?> ExecuteAndCatchExceptionAsync(Func<Task> func, ICollection<Exception>? exceptions)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | func | The async operation to execute. |
ICollection<Exception> | exceptions | The list of exception. |
Returns
Type | Description |
---|---|
Task<ICollection<Exception>> | The list of exceptions. The provided list is returned if no exception is thrown. |