move InvalidAttestationError into Attestation mod

Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
William Woodruff 2024-04-09 10:52:48 -04:00
parent 5ec3dab141
commit 2efef36313
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -783,6 +783,3 @@ class CyclicDependencyError < RuntimeError
EOS
end
end
# Raised when attestation verification fails.
class InvalidAttestationError < RuntimeError; end

View File

@ -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.