OpenInference JS
    Preparing search index...
    • Wraps a function with a try-catch block to catch and log any errors.

      Type Parameters

      Parameters

      • fn: { fn: T; onError?: (error: unknown) => void }

        A function to wrap with a try-catch block.

      Returns SafeFunction<T>

      A function that returns null if an error is thrown.