Exception: Gcloud::Storage::FileVerificationError
- Defined in:
- lib/gcloud/storage/errors.rb
Overview
# FileVerificationError
Raised when a File download fails the verification.
Instance Attribute Summary collapse
-
#gcloud_digest ⇒ Object
The value of the digest on the gcloud-ruby file.
-
#local_digest ⇒ Object
The value of the digest on the downloaded file.
-
#type ⇒ Object
The type of digest that failed verification, :md5 or :crc32c.
Class Method Summary collapse
Methods inherited from Error
from_error, gapi_error_class_for, grpc_error_class_for
Instance Attribute Details
#gcloud_digest ⇒ Object
The value of the digest on the gcloud-ruby file.
32 33 34 |
# File 'lib/gcloud/storage/errors.rb', line 32 def gcloud_digest @gcloud_digest end |
#local_digest ⇒ Object
The value of the digest on the downloaded file.
36 37 38 |
# File 'lib/gcloud/storage/errors.rb', line 36 def local_digest @local_digest end |
#type ⇒ Object
The type of digest that failed verification, :md5 or :crc32c.
28 29 30 |
# File 'lib/gcloud/storage/errors.rb', line 28 def type @type end |
Class Method Details
.for_crc32c(gcloud_digest, local_digest) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/gcloud/storage/errors.rb', line 48 def self.for_crc32c gcloud_digest, local_digest 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
39 40 41 42 43 44 45 |
# File 'lib/gcloud/storage/errors.rb', line 39 def self.for_md5 gcloud_digest, local_digest 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 |