Exception: Gcloud::Storage::FileVerificationError

Inherits:
Error
  • Object
show all
Defined in:
lib/gcloud/storage/errors.rb

Overview

Raised when a File download fails the verification.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#gcloud_digestObject

The value of the digest on the Gcloud file.



55
56
57
# File 'lib/gcloud/storage/errors.rb', line 55

def gcloud_digest
  @gcloud_digest
end

#local_digestObject

The value of the digest on the downloaded file.



59
60
61
# File 'lib/gcloud/storage/errors.rb', line 59

def local_digest
  @local_digest
end

#typeObject

The type of digest that failed verification, :md5 or :crc32c.



51
52
53
# File 'lib/gcloud/storage/errors.rb', line 51

def type
  @type
end

Class Method Details

.for_crc32c(gcloud_digest, local_digest) ⇒ Object

:nodoc:



69
70
71
72
73
74
75
# File 'lib/gcloud/storage/errors.rb', line 69

def self.for_crc32c gcloud_digest, local_digest #:nodoc:
  new("The downloaded file failed CRC32c verification.").tap do |e|
    e.type = :crc32c
    e.gcloud_digest = gcloud_digest
    e.local_digest = local_digest
  end
end

.for_md5(gcloud_digest, local_digest) ⇒ Object

:nodoc:



61
62
63
64
65
66
67
# File 'lib/gcloud/storage/errors.rb', line 61

def self.for_md5 gcloud_digest, local_digest #:nodoc:
  new("The downloaded file failed MD5 verification.").tap do |e|
    e.type = :md5
    e.gcloud_digest = gcloud_digest
    e.local_digest = local_digest
  end
end