code: function prepareStackTrace(error, stack) {
    if (emptyCacheBetweenOperations) {
      fileContentsCache = {};
      sourceMapCache = {};
    }
  
    var name = error.name || 'Error';
    var message = error.message || '';
    var errorString = name + ": " + message;
  
    return errorString + stack.map(function(frame) {
      return '\n    at ' + wrapCallSite(frame);
    }).join('');
  }
docs: This function is part of the V8 stack trace API, for more info see: https://v8.dev/docs/stack-trace-api