Class ExceptionCollectionExtensions | Localization | 0.5.1-preview
docs.unity.cn
    Show / Hide Table of Contents

    Class ExceptionCollectionExtensions

    Some IEnumerable extensions that catch exceptions into an ExceptionCollection. Very useful for unit tests and for deferring exceptions.

    Inheritance
    Object
    ExceptionCollectionExtensions
    Namespace: UnityEngine.Localization.SmartFormat.Tests.Common
    Syntax
    public static class ExceptionCollectionExtensions

    Methods

    TryAll<TSource>(IEnumerable<TSource>, Action<TSource>)

    Performs the action for each item, catching all exceptions into an ExceptionCollection.

    Declaration
    public static ExceptionCollection TryAll<TSource>(this IEnumerable<TSource> sources, Action<TSource> action)
    Parameters
    Type Name Description
    IEnumerable<TSource> sources
    Action<TSource> action
    Returns
    Type Description
    ExceptionCollection
    Type Parameters
    Name Description
    TSource

    TryAll<TSource, TException>(IEnumerable<TSource>, Action<TSource>)

    Performs the action for each item, catching all errors into an ExceptionCollection. Only catches the type of Exception that you specify.

    Declaration
    public static ExceptionCollection<TException> TryAll<TSource, TException>(this IEnumerable<TSource> sources, Action<TSource> action)
        where TException : Exception
    Parameters
    Type Name Description
    IEnumerable<TSource> sources
    Action<TSource> action
    Returns
    Type Description
    ExceptionCollection<TException>
    Type Parameters
    Name Description
    TSource
    TException
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX