module Trino::Client::ModelVersions::V303::ExecutionFailureInfo

Public Class Methods

decode(hash) click to toggle source
# File lib/trino/client/model_versions/303.rb, line 808
def decode(hash)
  unless hash.is_a?(Hash)
    raise TypeError, "Can't convert #{hash.class} to Hash"
  end
  obj = allocate
  obj.send(:initialize_struct,
    hash["type"],
    hash["message"],
    hash["cause"] && ExecutionFailureInfo.decode(hash["cause"]),
    hash["suppressed"] && hash["suppressed"].map {|h| ExecutionFailureInfo.decode(h) },
    hash["stack"],
    hash["errorLocation"] && ErrorLocation.decode(hash["errorLocation"]),
    hash["errorCode"] && ErrorCode.decode(hash["errorCode"]),
    hash["remoteHost"],
  )
  obj
end