Exception: Parse::Embeddings::InvalidImageURL

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

Overview

Raised when validate_image_url! rejects an input URL. Carries a :reason String so retry / logging code can branch on the specific failure mode (:scheme, :port, :userinfo, :host_blocked, :host_not_allowlisted, :dns_rebound, :parse).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, message) ⇒ InvalidImageURL

Returns a new instance of InvalidImageURL.



110
111
112
113
# File 'lib/parse/embeddings.rb', line 110

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

Instance Attribute Details

#reason ⇒ Symbol (readonly)

Returns failure-mode tag.

Returns:

  • (Symbol) —

    failure-mode tag.



108
109
110
# File 'lib/parse/embeddings.rb', line 108

def reason
  @reason
end