function createDependencyError(dependency, error) {
  const err = new Error(`Dependency "${dependency.id}" failed with exception: ${error.message}`);
  // @ts-expect-error - We already reported the original error to Sentry, don't do it again.
  err.expected = true;
  return err;
}
@param {{id: string}} dependency
@param {Error} error