ChemPal Documentation - v1.7.0
    Preparing search index...

    Function recordException

    • Records an arbitrary thrown value into the ring buffer, folding its cause chain (and any AggregateError sub-errors) into the stored stack. Convenience over recordError for callers that hold the raw error.

      Parameters

      • reason: unknown

        The thrown value or rejection reason.

      • source: ErrorSource

        Where the error originated.

      Returns Promise<void>

      A promise that resolves once the write settles.

      await recordException(new AggregateError(errs, "search failed"), "search");
      
      export async function recordException(reason: unknown, source: ErrorSource): Promise<void> {
      return recordError({ source, ...describeError(reason) });
      }