Class: ZendeskAPI::Error::RecordInvalid

Inherits:
ClientError
  • Object
show all
Defined in:
lib/zendesk_api/error.rb

Instance Attribute Summary collapse

Attributes inherited from ClientError

#wrapped_exception

Instance Method Summary collapse

Constructor Details

#initializeRecordInvalid

Returns a new instance of RecordInvalid.



19
20
21
22
23
24
25
26
27
# File 'lib/zendesk_api/error.rb', line 19

def initialize(*)
  super

  if response[:body].is_a?(Hash)
    @errors = response[:body]["details"] || generate_error_msg(response[:body])
  end

  @errors ||= {}
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



17
18
19
# File 'lib/zendesk_api/error.rb', line 17

def errors
  @errors
end

Instance Method Details

#to_sObject



29
30
31
# File 'lib/zendesk_api/error.rb', line 29

def to_s
  "#{self.class.name}: #{@errors}"
end