Exception: OutsideIn::QueryException

Inherits:
Exception
  • Object
show all
Defined in:
lib/outside_in.rb

Overview

Indicates that a query request returned an error response.

Since:

  • 1.0

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ OutsideIn::QueryException

Returns a new instance.

Parameters:

  • data (Hash<String, Object>)

    the error hash returned in the query response body

Since:

  • 1.0



72
73
74
75
76
77
78
79
80
# File 'lib/outside_in.rb', line 72

def initialize(data)
  if data.include?('error')
    super(data['error'])
  elsif data.include?('errors')
    super(data['errors'].join('; '))
  else
    super('unknown query error')
  end
end