Documentation
    Preparing search index...

    Function captureStackTrace

    • Safely captures stack trace using V8's Error.captureStackTrace if available.

      This utility provides a type-safe way to use Error.captureStackTrace without needing to check for its existence at every call site.

      Parameters

      • targetObject: object

        Object to attach stack trace to (typically 'this' in an Error constructor)

      • OptionalconstructorOpt: new (...args: any[]) => any

        Constructor function to hide from stack trace

      Returns void

      class MyError extends Error {
      constructor() {
      super();
      captureStackTrace(this, MyError);
      }
      }