Exception: AtlasRb::FixityMismatchError
- Defined in:
- lib/atlas_rb/errors.rb
Overview
Authorization failures surface as ForbiddenError (HTTP 403).
Raised when Atlas rejects a binary upload's verify-on-ingest check with a
422 carrying a fixity discriminator — fixity_mismatch (the uploaded
bytes don't match the supplied expected_digest) or
unsupported_digest_algorithm (a malformed/unknown expected_digest).
Fires on POST /files, PATCH /files/:id, and PATCH /file_sets/:id.
The upload sibling of ReparentError / LinkedMemberError; same shape,
same rationale — without it the ["blob"] / ["file_set"] unwrap would
return nil on the 422 and discard the signal a migration needs to tell a
corrupted transfer from a clean one. Atlas rejects before persisting, so
nothing is left behind to clean up.
rescue AtlasRb::FixityMismatchError => e # e.code == "fixity_mismatch": re-fetch the source, retry, or quarantine
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
The machine-readable error code from the envelope (
"fixity_mismatch"or"unsupported_digest_algorithm"). -
#resource_id ⇒ String?
readonly
The rejected resource's ID, from the envelope (the FileSet on the attach path; may be nil on
POST /files).
Instance Method Summary collapse
-
#initialize(message, code: nil, resource_id: nil) ⇒ FixityMismatchError
constructor
A new instance of FixityMismatchError.
Constructor Details
#initialize(message, code: nil, resource_id: nil) ⇒ FixityMismatchError
Returns a new instance of FixityMismatchError.
165 166 167 168 169 |
# File 'lib/atlas_rb/errors.rb', line 165 def initialize(, code: nil, resource_id: nil) super() @code = code @resource_id = resource_id end |
Instance Attribute Details
#code ⇒ String? (readonly)
Returns the machine-readable error code from the envelope
("fixity_mismatch" or "unsupported_digest_algorithm").
156 157 158 |
# File 'lib/atlas_rb/errors.rb', line 156 def code @code end |
#resource_id ⇒ String? (readonly)
Returns the rejected resource's ID, from the envelope (the
FileSet on the attach path; may be nil on POST /files).
160 161 162 |
# File 'lib/atlas_rb/errors.rb', line 160 def resource_id @resource_id end |