diff --git a/npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb b/npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb index f5ef768942..c7b73287e8 100644 --- a/npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb +++ b/npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb @@ -553,6 +553,11 @@ def self.package_manager_run_command(name, command, fingerprint: nil) result rescue StandardError => e Dependabot.logger.error("Error running package manager command: #{full_command}, Error: #{e.message}") + if e.message.include?("\e[38;5;111mResponse Code\e[39m: \e[38;5;220m404\e[39m (Not Found)\n") && + e.message.include?("The remote server failed to provide the requested resource") + raise RegistryError.new(404, "The remote server failed to provide the requested resource") + end + raise end