Skip to content
Snippets Groups Projects
Select Git revision
  • a4c985b9ca7180383723e9d514ad9b8f46006f15
  • main default protected
  • renovate/github.com-hashicorp-nomad-api-digest
  • renovate/github.com-hetznercloud-hcloud-go-v2-2.x
  • renovate/apricote-releaser-pleaser-0.x
  • renovate/golang.org-x-sys-0.x
  • release-please--branches--main--components--csi-driver
  • v2.16.0 protected
  • v2.15.0 protected
  • v2.14.0 protected
  • v2.13.0 protected
  • v2.12.0 protected
  • v2.11.0 protected
  • v2.10.1 protected
  • v2.10.0 protected
  • v2.9.0 protected
  • v2.8.0 protected
  • v2.7.1 protected
  • v2.7.0 protected
  • v2.6.0 protected
  • v2.5.1 protected
  • v2.5.0 protected
  • v2.4.0 protected
  • v2.3.2 protected
  • v2.3.1 protected
  • v2.3.0 protected
  • v2.3.0-rc.0 protected
27 results

README.md

Blame
  • error.ts 7.25 KiB
    import type { RenovateConfig } from '../../config/types';
    
    import {
      CONFIG_SECRETS_EXPOSED,
      CONFIG_VALIDATION,
      EXTERNAL_HOST_ERROR,
      MANAGER_LOCKFILE_ERROR,
      NO_VULNERABILITY_ALERTS,
      PLATFORM_AUTHENTICATION_ERROR,
      PLATFORM_BAD_CREDENTIALS,
      PLATFORM_INTEGRATION_UNAUTHORIZED,
      PLATFORM_RATE_LIMIT_EXCEEDED,
      REPOSITORY_ACCESS_FORBIDDEN,
      REPOSITORY_ARCHIVED,
      REPOSITORY_BLOCKED,
      REPOSITORY_CANNOT_FORK,
      REPOSITORY_CHANGED,
      REPOSITORY_CLOSED_ONBOARDING,
      REPOSITORY_DISABLED,
      REPOSITORY_DISABLED_BY_CONFIG,
      REPOSITORY_EMPTY,
      REPOSITORY_FORKED,
      REPOSITORY_MIRRORED,
      REPOSITORY_NOT_FOUND,
      REPOSITORY_NO_CONFIG,
      REPOSITORY_NO_PACKAGE_FILES,
      REPOSITORY_RENAMED,
      REPOSITORY_UNINITIATED,
      SYSTEM_INSUFFICIENT_DISK_SPACE,
      SYSTEM_INSUFFICIENT_MEMORY,
      TEMPORARY_ERROR,
      UNKNOWN_ERROR,
    } from '../../constants/error-messages';
    import { logger } from '../../logger';
    import { ExternalHostError } from '../../types/errors/external-host-error';
    import { raiseConfigWarningIssue } from './error-config';
    
    export default async function handleError(
      config: RenovateConfig,
      err: Error
    ): Promise<string> {
      if (err.message === REPOSITORY_UNINITIATED) {
        logger.info('Repository is uninitiated - skipping');
        delete config.branchList; // eslint-disable-line no-param-reassign
        return err.message;
      }
      if (err.message === REPOSITORY_EMPTY) {
        logger.info('Repository is empty - skipping');
        delete config.branchList; // eslint-disable-line no-param-reassign
        return err.message;
      }
      const disabledMessages = [
        REPOSITORY_CLOSED_ONBOARDING,
        REPOSITORY_DISABLED,
        REPOSITORY_DISABLED_BY_CONFIG,
        REPOSITORY_NO_CONFIG,
      ];
      if (disabledMessages.includes(err.message)) {
        logger.info('Repository is disabled - skipping');
        return err.message;
      }
      if (err.message === REPOSITORY_ARCHIVED) {
        logger.info('Repository is archived - skipping');
        delete config.branchList; // eslint-disable-line no-param-reassign
        return err.message;
      }
      if (err.message === REPOSITORY_MIRRORED) {
        logger.info('Repository is a mirror - skipping');
        delete config.branchList; // eslint-disable-line no-param-reassign
        return err.message;