Sha256: c72eacdc5a62f804b429cef0a81eb688050296711bad75d5f5e451d713e11d43

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

class Kintone::KintoneError < StandardError
  attr_reader :message_text, :id, :code, :http_status, :errors

  def initialize(messages, http_status)
    if messages.is_a?(Hash) && messages.has_key?('results')
      messages = messages['results'].find { |message| message.has_key?('message') }
    end
    @message_text = messages['message']
    @id = messages['id']
    @code = messages['code']
    @errors = messages['errors']
    @http_status = http_status
    super(format('%s [%s] %s(%s)', @http_status, @code, @message_text, @id))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kintone_rb-1.0.1 lib/kintone/kintone_error.rb