Exception: ContentGateway::ValidationError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/content_gateway/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from BaseError

#info, #resource_url, #status_code, #wrapped_exception

Instance Method Summary collapse

Constructor Details

#initialize(resource_url, wrapped_exception = nil) ⇒ ValidationError

Returns a new instance of ValidationError.



56
57
58
59
60
61
62
63
# File 'lib/content_gateway/exceptions.rb', line 56

def initialize(resource_url, wrapped_exception = nil)
  super(resource_url, wrapped_exception, 422)

  if wrapped_exception
    response = wrapped_exception.response
    @errors = JSON.parse(response) if response.present?
  end
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



54
55
56
# File 'lib/content_gateway/exceptions.rb', line 54

def errors
  @errors
end