Exception: TableauApi::TableauError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tableau_api/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(net_response) ⇒ TableauError

Returns a new instance of TableauError.



5
6
7
8
9
10
11
12
# File 'lib/tableau_api/error.rb', line 5

def initialize(net_response)
  @http_response_code = net_response.code
  error = HTTParty::Parser.new(net_response.body, :xml).parse['tsResponse']['error']
  @error_code = error['code']
  @summary = error['summary']
  @detail = error['detail']
  super("#{error_code}: #{summary}; #{detail}")
end

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail.



3
4
5
# File 'lib/tableau_api/error.rb', line 3

def detail
  @detail
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



3
4
5
# File 'lib/tableau_api/error.rb', line 3

def error_code
  @error_code
end

#http_response_codeObject (readonly)

Returns the value of attribute http_response_code.



3
4
5
# File 'lib/tableau_api/error.rb', line 3

def http_response_code
  @http_response_code
end

#summaryObject (readonly)

Returns the value of attribute summary.



3
4
5
# File 'lib/tableau_api/error.rb', line 3

def summary
  @summary
end