@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function tryCatchAsync

    • Wraps the function passed to asyncFunc in a try/catch block to reduce boilerplate code.

      Type Parameters

      • T

      Parameters

      • asyncFunc: () => Promise<T>

        The function to wrap in the try/catch.

      • fallback: T

        Custom fallback value or error message.

      Returns Promise<T>

      A promise determined by the input function.