Exception: Gcloud::Storage::FileVerificationError

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

Overview

# FileVerificationError

Raised when a File download fails the verification.

Instance Attribute Summary collapse

Attributes inherited from Error

#inner

Class Method Summary collapse

Methods inherited from Error

from_error, #initialize, klass_for

Constructor Details

This class inherits a constructor from Gcloud::Error

Instance Attribute Details

#gcloud_digestObject

The value of the digest on the Gcloud file.



66
67
68
# File 'lib/gcloud/storage/errors.rb', line 66

def gcloud_digest
  @gcloud_digest
end

#local_digestObject

The value of the digest on the downloaded file.



70
71
72
# File 'lib/gcloud/storage/errors.rb', line 70

def local_digest
  @local_digest
end

#typeObject

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



62
63
64
# File 'lib/gcloud/storage/errors.rb', line 62

def type
  @type
end

Class Method Details

.for_crc32c(gcloud_digest, local_digest) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/gcloud/storage/errors.rb', line 82

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



73
74
75
76
77
78
79
# File 'lib/gcloud/storage/errors.rb', line 73

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