interface ErrorConstructorMethodscaptureStackTrace(error: Object, constructor?: Function): voidSee https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions.