Exception: Html2img::ValidationError

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

Overview

Raised on a 400 or 422 when one or more request fields fail validation. The API code is validation_error.

Instance Attribute Summary collapse

Attributes inherited from Error

#error_code, #payload, #status_code

Instance Method Summary collapse

Methods inherited from Error

#to_s

Constructor Details

#initialize(message, details: {}, **options) ⇒ ValidationError

Returns a new instance of ValidationError.



62
63
64
65
# File 'lib/html2img/errors.rb', line 62

def initialize(message, details: {}, **options)
  super(message, **options)
  @details = details || {}
end

Instance Attribute Details

#detailsHash{String => Array<String>} (readonly)

Returns per-field validation messages.

Returns:

  • (Hash{String => Array<String>})

    per-field validation messages



60
61
62
# File 'lib/html2img/errors.rb', line 60

def details
  @details
end