Class ExceptionCollectionExtensions | Localization | 0.5.1-preview
docs.unity3d.com
    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 © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023