Exception: Parse::Embeddings::ImageFetch::InvalidImageType

Inherits:
Error
  • Object
show all
Defined in:
lib/parse/embeddings/image_fetch.rb

Overview

Raised when downloaded bytes fail content verification — unknown magic bytes, sniffed type outside the allowlist, or an extension / magic-byte disagreement. Carries a :reason tag (:unknown_magic, :type_not_allowed, :extension_mismatch, :empty) so callers can branch on the failure mode.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, message) ⇒ InvalidImageType

Returns a new instance of InvalidImageType.



59
60
61
62
# File 'lib/parse/embeddings/image_fetch.rb', line 59

def initialize(reason, message)
  @reason = reason
  super(message)
end

Instance Attribute Details

#reasonSymbol (readonly)

Returns failure-mode tag.

Returns:

  • (Symbol)

    failure-mode tag.



58
59
60
# File 'lib/parse/embeddings/image_fetch.rb', line 58

def reason
  @reason
end