diff --git a/Library/Homebrew/attestation.rb b/Library/Homebrew/attestation.rb index 0c47aff12e..ecf53d56f9 100644 --- a/Library/Homebrew/attestation.rb +++ b/Library/Homebrew/attestation.rb @@ -30,6 +30,11 @@ module Homebrew # @api private BACKFILL_CUTOFF = DateTime.new(2024, 3, 14).freeze + # Raised when attestation verification fails. + # + # @api private + class InvalidAttestationError < RuntimeError; end + # Returns a path to a suitable `gh` executable for attestation verification. # # @api private diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index d625491e94..1094c7e517 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -783,6 +783,3 @@ class CyclicDependencyError < RuntimeError EOS end end - -# Raised when attestation verification fails. -class InvalidAttestationError < RuntimeError; end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 2d7985b160..4c1503033b 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1261,7 +1261,7 @@ on_request: installed_on_request?, options:) ohai "Verifying attestation for #{formula.name}" begin Homebrew::Attestation.check_core_attestation formula.bottle - rescue InvalidAttestationError => e + rescue Homebrew::Attestation::InvalidAttestationError => e raise CannotInstallFormulaError, <<~EOS The bottle for #{formula.name} has an invalid build provenance attestation.