Class: Presto::Client::QueryError

Inherits:
Object
  • Object
show all
Defined in:
lib/presto/client/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ QueryError

Returns a new instance of QueryError.



191
192
193
194
195
196
197
# File 'lib/presto/client/models.rb', line 191

def initialize(options={})
  @message = options[:message]
  @sql_state = options[:sql_state]
  @error_code = options[:error_code]
  @error_location = options[:error_location]
  @failure_info = options[:failure_info]
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



187
188
189
# File 'lib/presto/client/models.rb', line 187

def error_code
  @error_code
end

#error_locationObject (readonly)

Returns the value of attribute error_location.



188
189
190
# File 'lib/presto/client/models.rb', line 188

def error_location
  @error_location
end

#failure_infoObject (readonly)

Returns the value of attribute failure_info.



189
190
191
# File 'lib/presto/client/models.rb', line 189

def failure_info
  @failure_info
end

#messageObject (readonly)

Returns the value of attribute message.



185
186
187
# File 'lib/presto/client/models.rb', line 185

def message
  @message
end

#sql_stateObject (readonly)

Returns the value of attribute sql_state.



186
187
188
# File 'lib/presto/client/models.rb', line 186

def sql_state
  @sql_state
end

Class Method Details

.decode_hash(hash) ⇒ Object



199
200
201
202
203
204
205
206
207
# File 'lib/presto/client/models.rb', line 199

def self.decode_hash(hash)
  new(
    message: hash["message"],
    sql_state: hash["sqlState"],
    error_code: hash["errorCode"],
    error_location: hash["errorLocation"] && ErrorLocation.decode_hash(hash["errorLocation"]),
    failure_info: hash["failureInfo"] && FailureInfo.decode_hash(hash["failureInfo"]),
  )
end